xtern commented on code in PR #4256:
URL: https://github.com/apache/ignite-3/pull/4256#discussion_r1739640676
##########
modules/catalog-compaction/src/test/java/org/apache/ignite/internal/catalog/compaction/CatalogCompactionRunnerSelfTest.java:
##########
@@ -163,9 +185,12 @@ public void routineSucceedOnCoordinator() throws
InterruptedException {
// Nothing should be changed if previous catalog doesn't exists.
Catalog earliestCatalog =
Objects.requireNonNull(catalogManager.catalog(catalogManager.earliestCatalogVersion()));
compactionRunner = createRunner(NODE1, NODE1, (n) ->
earliestCatalog.time());
- compactionRunner.triggerCompaction(clockService.now());
+
+ HybridTimestamp now = clockService.now();
+ compactionRunner.onLowWatermarkChanged(now);
+ compactionRunner.triggerCompaction(now);
Review Comment:
```suggestion
```
Why do we need to trigger the compaction twice?
Please, fix it in other places too.
##########
modules/catalog-compaction/src/main/java/org/apache/ignite/internal/catalog/compaction/CatalogCompactionRunner.java:
##########
@@ -387,24 +437,55 @@ private CompletableFuture<Boolean>
tryCompactCatalog(Catalog catalog, LogicalTop
}
return
catalogManagerFacade.compactCatalog(catalog.version());
+ }).whenComplete((res, ex) -> {
+ if (ex != null) {
+ LOG.warn("Catalog compaction has failed
[timestamp={}].", ex, minRequiredTime);
+ } else {
+ if (res) {
+ LOG.info("Catalog compaction completed
successfully [timestamp={}].", minRequiredTime);
+ } else {
+ LOG.info("Catalog compaction skipped
[timestamp={}].", minRequiredTime);
+ }
+ }
});
}
- private CompletableFuture<Set<String>> requiredNodes(Catalog catalog) {
+ private CompletableFuture<Pair<Boolean, Set<String>>> validatePartitions(
+ Catalog catalog,
+ Map<String, Map<Integer, BitSet>> remotePartitions
+ ) {
HybridTimestamp nowTs = clockService.now();
Set<String> required = Collections.newSetFromMap(new
ConcurrentHashMap<>());
Review Comment:
We don't need this Set anymore, because it can be replaced with
`actualPartitions.keySet()`
--
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]