li4wang commented on code in PR #1961:
URL: https://github.com/apache/zookeeper/pull/1961#discussion_r1067627020
##########
zookeeper-server/src/main/java/org/apache/zookeeper/server/ZooKeeperServer.java:
##########
@@ -1151,6 +1213,9 @@ protected void setLocalSessionFlag(Request si) {
}
public void submitRequest(Request si) {
+ if (state == State.MAINTENANCE) {
+ throw new IllegalStateException("Zookeeper server is in
maintenance state");
+ }
Review Comment:
> `If not, I suggest another solution: create a semaphore which is closed
while the maintenace is happening and block this thread until it's finished.
The request will suffer some additionaly latency, but otherwise cannot be
noticed. Thoughts?`
Blocking the thread doesn't change the behavior as the request fails before
being sent to the server. In addition, as pointed out, it can potentially
increase the latency.
Since the restore feature is really designed for recovering from rarely
happed disaster failure (i.e. quorum lost), Not accepting any client requests
in that scenario should be ok, right? WDYT?
--
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]