AmandeepSingh285 commented on code in PR #3695:
URL: https://github.com/apache/celeborn/pull/3695#discussion_r3272759707
##########
worker/src/main/java/org/apache/celeborn/service/deploy/worker/shuffledb/RocksDBIterator.java:
##########
@@ -33,20 +34,32 @@ public class RocksDBIterator implements DBIterator {
private final RocksIterator it;
private final MetadataMetrics metrics;
+ private final AtomicLong dbGeneration;
+ private final long creationGeneration;
private boolean checkedNext;
private boolean closed;
private Map.Entry<byte[], byte[]> next;
- public RocksDBIterator(RocksIterator it, MetadataMetrics metrics) {
+ public RocksDBIterator(
+ RocksIterator it, MetadataMetrics metrics, AtomicLong dbGeneration, long
creationGeneration) {
this.it = it;
this.metrics = metrics;
+ this.dbGeneration = dbGeneration;
+ this.creationGeneration = creationGeneration;
+ }
+
+ private void checkGeneration() {
+ if (dbGeneration.get() != creationGeneration) {
+ throw new IllegalStateException("DB instance was recreated, iterator is
stale");
Review Comment:
Done closed stale iterators
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]