aljoscha commented on a change in pull request #14765:
URL: https://github.com/apache/flink/pull/14765#discussion_r565457375



##########
File path: 
flink-state-backends/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/iterator/RocksStatesPerKeyGroupMergeIterator.java
##########
@@ -132,10 +145,14 @@ public void next() {
             final RocksIteratorWrapper rocksIterator = 
rocksIteratorWithKVStateId.f0;
             rocksIterator.seekToFirst();
             if (rocksIterator.isValid()) {
-                iteratorPriorityQueue.offer(
-                        new RocksSingleStateIterator(rocksIterator, 
rocksIteratorWithKVStateId.f1));
+                RocksSingleStateIterator wrappingIterator =
+                        new RocksSingleStateIterator(rocksIterator, 
rocksIteratorWithKVStateId.f1);
+                iteratorPriorityQueue.offer(wrappingIterator);
+                closeableRegistry.registerCloseable(wrappingIterator);
+                closeableRegistry.unregisterCloseable(rocksIterator);

Review comment:
       See answer above.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to