Browse Source

ZOOKEEPER-3472: Treat check request as a write request which needs to wait for the check txn commit from leader

Check op is usually used as a sub op in multi, but from the ZooKeeper server implementation it can also called separately, the learner will forward this request to leader, and the leader will check the version with the given version in the request, and generate a txn (error) in the quorum.

There is no explicit API exposed for check, but it could leave an issue there if the check API is exposed in the future.

Also because the check API is not exposed, we cannot write an E2E test for check here.

Author: Fangmin Lyu <fangmin@apache.org>

Reviewers: Michael Han <hanm@apache.org>

Closes #1026 from lvfangmin/ZOOKEEPER-3472
Fangmin Lyu 6 years ago
parent
commit
1d4aaf7ca2

+ 1 - 0
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/CommitProcessor.java

@@ -186,6 +186,7 @@ public class CommitProcessor extends ZooKeeperCriticalThread implements
             case OpCode.reconfig:
             case OpCode.multi:
             case OpCode.setACL:
+            case OpCode.check:
                 return true;
             case OpCode.sync:
                 return matchSyncs;