bitflicker64 commented on code in PR #3237:
URL: https://github.com/apache/hugegraph/pull/3237#discussion_r4120086362


##########
hugegraph-pd/hg-pd-core/src/main/java/org/apache/hugegraph/pd/raft/RaftEngine.java:
##########
@@ -602,6 +624,69 @@ public Node getRaftNode() {
         return raftNode;
     }
 
+    /**
+     * Wait until this node has applied every entry committed before the call, 
so a local
+     * read that follows sees every write acknowledged before it. jraft's 
ReadIndex confirms
+     * the commit index with a quorum in the current term and runs the closure 
once the
+     * applied index reaches it; a leader elected a moment ago first waits for 
an entry of
+     * its own term to commit. Bounded by the raft rpc timeout.
+     * <p>
+     * Never call it on the state machine thread: the closure waits for that 
thread to apply.
+     */
+    public void waitReadIndex() throws PDException {

Review Comment:
   Minor: This ReadIndex wait, and the other four stage A commits (`1d4335fdd` 
snapshot checkpoint on the FSM thread, `8d6e18684` `raft.rpc-connect-timeout`, 
`be867b28c` hstore truncate keeping the schema id counters, `c26d96130` the 
`AUTH/` prefix), fix master bugs that do not depend on the schema version work. 
In this PR they are tied to a design that has an open CHANGES_REQUESTED review 
and a planned rewrite (stages B to E), so fixes for duplicate PD id ranges, 
double-applied snapshot entries and wiped `AUTHx` graphs wait for that design 
to settle. apache/hugegraph squash-merges, so they would also land as one 
commit titled `fix(server): converge schema caches across HStore servers`, 
which makes any one of them hard to find or revert, and the PR description does 
not mention them or the new PD options. Requested change: move the stage A 
commits into their own PR (or one PR per module, PD and server), each with its 
own description and tests, and keep this PR to the schema cache prot
 ocol.



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