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


##########
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:
   The reason I haven't, and I should add a comment to this effect, is that I 
don't want us to participate in any quorum until after a majority quorum has 
been reached (so that we aren't counted towards the DurableBefore Majority 
condition, as we don't really count for anything pre-bootstrap, as we don't 
wait for it). 
   
   There is certainly a cleaner and more robust way to do this, where we track 
this explicitly and ensure this information is incorporated when counting 
votes. But, this suffices for now.



-- 
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: pr-unsubscr...@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscr...@cassandra.apache.org
For additional commands, e-mail: pr-h...@cassandra.apache.org

Reply via email to