zstan commented on code in PR #3075:
URL: https://github.com/apache/ignite-3/pull/3075#discussion_r1464385762


##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java:
##########
@@ -156,15 +162,62 @@ public CompletableFuture<Boolean> append(VersionedUpdate 
update) {
         }
     }
 
+    @Override
+    public CompletableFuture<Boolean> saveSnapshot(SnapshotUpdate update) {
+        if (!busyLock.enterBusy()) {
+            return failedFuture(new IgniteException(Common.NODE_STOPPING_ERR, 
new NodeStoppingException()));
+        }
+
+        // Note: below, we optimistically get local snapshot version, then 
prepare list of outdated updates, then atomically replace
+        // old snapshot using relaxed condition (old snapshop version < new 
snapshot version) and cleaup the log.

Review Comment:
   ```suggestion
           // old snapshot using relaxed condition (old snapshot version < new 
snapshot version) and cleanup the log.
   ```



##########
modules/catalog/src/main/java/org/apache/ignite/internal/catalog/storage/UpdateLogImpl.java:
##########
@@ -198,6 +251,10 @@ static ByteArray update(int version) {
         static ByteArray updatePrefix() {
             return ByteArray.fromString("catalog.update.");
         }
+
+        public static ByteArray snapshotVersion() {
+            return ByteArray.fromString("catalog.snapshot.version");

Review Comment:
   seems it need to be analogy formed like : 
DistributionZonesUtil#zonesRecoverableStateRevision ?



-- 
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]

Reply via email to