tkalkirill commented on code in PR #4632: URL: https://github.com/apache/ignite-3/pull/4632#discussion_r1816778171
########## modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java: ########## @@ -224,34 +214,24 @@ public long getCompactionRevision() { } @Override - public void startCompaction(long compactionRevision) { + public void updateCompactionRevision(long compactionRevision, KeyValueUpdateContext context) { assert compactionRevision >= 0 : compactionRevision; rwLock.writeLock().lock(); try { assertCompactionRevisionLessThanCurrent(compactionRevision, rev); + saveCompactionRevision(compactionRevision, context); + if (isInRecoveryState()) { - this.compactionRevision = compactionRevision; + setCompactionRevision(compactionRevision); } else { - watchProcessor - .addTaskToWatchEventQueue(() -> setCompactionRevision(compactionRevision)) - .thenComposeAsync(unused -> readOperationsFuture(compactionRevision), compactionExecutor) - .thenRunAsync(() -> compact(compactionRevision), compactionExecutor) - .whenCompleteAsync((unused, throwable) -> { - if (throwable == null) { - log.info("Metastore compaction completed successfully: [compactionRevision={}]", compactionRevision); - } else { - log.error( - "Metastore compaction failed: [compactionRevision={}]", - unwrapCause(throwable), - compactionRevision - ); - } - - notifyCompleteCompactionLocally(this.compactionRevision, throwable); - }, compactionExecutor); + watchProcessor.addTaskToWatchEventQueue(() -> { Review Comment: fix it ########## modules/metastorage/src/main/java/org/apache/ignite/internal/metastorage/server/AbstractKeyValueStorage.java: ########## @@ -334,18 +314,13 @@ public void watchExact(byte[] key, long rev, WatchListener listener) { } @Override - public CompletableFuture<Void> readOperationsFuture(long compactionRevisionExcluded) { - return readOperationForCompactionTracker.collect(compactionRevisionExcluded); - } - - @Override - public void registerCompactionListener(CompactionListener listener) { - compactionListeners.add(listener); + public void registerCompactionRevisionUpdateListener(CompactionRevisionUpdateListener listener) { Review Comment: fix it -- 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: notifications-unsubscr...@ignite.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org