belliottsmith commented on code in PR #233:
URL: https://github.com/apache/cassandra-accord/pull/233#discussion_r2246264741


##########
accord-core/src/main/java/accord/local/Bootstrap.java:
##########
@@ -135,20 +138,24 @@ void start(SafeCommandStore safeStore)
             // of these ranges as part of this attempt
             Ranges commitRanges = valid;
             safeStore = safeStore;
-            // we submit a separate execution so that we know 
markBootstrapping is durable before we initiate the fetch
-            safeStore.commandStore()
-                     .build((PreLoadContext.Empty) () -> "Start Bootstrap RX", 
safeStore0 -> {
-                         store.markBootstrapping(safeStore0, globalSyncId, 
commitRanges);
-                         return CoordinateSyncPoint.exclusive(node, 
globalSyncId, commitRanges);
-                     })
-                     .flatMap(i -> i)
-                     .flatMap(syncPoint -> node.withEpochAtLeast(epoch, null, 
() -> store.build((PreLoadContext.Empty) () -> "Start Bootstrap Fetch", 
safeStore1 -> {
-                         if (valid.isEmpty()) // we've lost ownership of the 
range
-                             return AsyncResults.success(Ranges.EMPTY);
-                         return fetch = safeStore1.dataStore().fetch(node, 
safeStore1, valid, syncPoint, this);
-                     })))
-                     .flatMap(i -> i)
-                     .begin(this);
+            CommandStore commandStore = safeStore.commandStore();
+            node.durability()
+                // we first make sure the sync point is durable to a majority, 
since any later durability conditions
+                // this node participates in will not guarantee a quorum for 
preceding transactions
+                .sync("Bootstrap " + commitRanges + " for " + 
safeStore.commandStore(), globalSyncId, commitRanges, NoLocal, Quorum, 1L, 
TimeUnit.HOURS)
+                .flatMap(success -> commandStore.build((PreLoadContext.Empty) 
() -> "Start Bootstrap RX", safeStore0 -> {
+                    // we submit a separate execution so that we know 
markBootstrapping is durable before we initiate the fetch
+                    store.markBootstrapping(safeStore0, globalSyncId, 
commitRanges);

Review Comment:
   To be fair, it might be a relatively small thing to add that more robust 
logic as part of this patch. I'll mull on it overnight.



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


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to