[ https://issues.apache.org/jira/browse/FLINK-7700?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16182550#comment-16182550 ]
ASF GitHub Bot commented on FLINK-7700: --------------------------------------- Github user StefanRRichter commented on a diff in the pull request: https://github.com/apache/flink/pull/4731#discussion_r141340929 --- Diff: flink-contrib/flink-statebackend-rocksdb/src/main/java/org/apache/flink/contrib/streaming/state/RocksDBKeyedStateBackend.java --- @@ -1978,4 +1979,25 @@ public File getInstanceBasePath() { public boolean supportsAsynchronousSnapshots() { return true; } + + @VisibleForTesting + @SuppressWarnings("unchecked") + @Override + public int numStateEntries() { + int count = 0; + + for (Tuple2<ColumnFamilyHandle, RegisteredKeyedBackendStateMetaInfo<?, ?>> column : kvStateInformation.values()) { + RocksIterator rocksIterator = db.newIterator(column.f0); + rocksIterator.seekToFirst(); + + while (rocksIterator.isValid()) { + count++; + rocksIterator.next(); + } + rocksIterator.close(); --- End diff -- Could use try-with-resource here. > State merging in RocksDB backend leaves old state > ------------------------------------------------- > > Key: FLINK-7700 > URL: https://issues.apache.org/jira/browse/FLINK-7700 > Project: Flink > Issue Type: Bug > Components: State Backends, Checkpointing > Affects Versions: 1.4.0, 1.3.2 > Reporter: Aljoscha Krettek > Assignee: Aljoscha Krettek > Priority: Blocker > Fix For: 1.4.0, 1.3.3 > > > {{RocksDBAggregatingState.mergeNamespaces(...)}}, > {{RocksDBReducingState.mergeNamespaces(...)}}, and > {{RocksDBListState.mergeNamespaces(...)}} don't remove state from the old > location when merging. This means that merged state will never be cleaned up > and will accumulate. -- This message was sent by Atlassian JIRA (v6.4.14#64029)