hanm commented on a change in pull request #1172: ZOOKEEPER-3594: Ability to
skip proposing requests with error transactions
URL: https://github.com/apache/zookeeper/pull/1172#discussion_r360623718
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/quorum/LearnerHandler.java
##########
@@ -1159,4 +1178,43 @@ public void setFirstPacket(boolean value) {
needOpPacket = value;
}
+ private final SkippedRequestQueue skippedRequestQueue = new
SkippedRequestQueue();
+
+ /**
+ * This method must be called from the RP chain thread
+ * right after PrepRequestProcessor. Once it's known that
+ * the request is invalid we can skip sending PROPOSE and go directly to
+ * COMMIT but we need to wait to do that in order with the other requests.
+ *
+ * The request will be immediately sent back to the learner if there is no
pending commits
+ * otherwise the request will be put inside the handler's queue to wait
for pending commit
+ * to complete before is sent so we make sure we send all requests in
order.
+ */
Review comment:
we can remove these comments, they are duplicate of the same comments on the
`SkipRequestHandler` interface.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services