-
Notifications
You must be signed in to change notification settings - Fork 7.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ZOOKEEPER-4712: Fix partially shutdown of ZooKeeperServer and its processors #2154
Merged
Merged
Changes from 1 commit
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c4e7e42
Avoid NPE when closing SendAckRequestProcessor after other failure
jonmv 8d055cc
Fix shutdown method overrides, so, e.g., SyncRequestProcessor is shut…
jonmv d82213e
Remove shutdown(boolean) from OZKS, which was identical to that of LZKS
jonmv 13001bf
Correctly propagate ZKDB.clear during shutdown of not-running ZKS chi…
jonmv 5d7aa33
Shut down sync processor before parent ZKS; it uses TXN-log during pa…
jonmv 41e6e95
ZOOKEEPER-4712: Add test case to assert request processors got shutdo…
kezhuw 56e959d
Merge pull request #1 from kezhuw/ZOOKEEPER-4712-test-case
jonmv c0682d7
Refactor shutdown to avoid requiring repeated logic in children
jonmv 3d6f619
Fix spotbugs failure
kezhuw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -97,7 +97,7 @@ public Boolean answer(InvocationOnMock invocation) throws Throwable { | |
} | ||
}); | ||
|
||
ZKDatabase database = new ZKDatabase(null); | ||
ZKDatabase database = new ZKDatabase(mock(FileTxnSnapLog.class)); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Otherwise: NPE during fast-forward during shutdown. |
||
database.setlastProcessedZxid(2L); | ||
QuorumPeer quorumPeer = mock(QuorumPeer.class); | ||
FileTxnSnapLog logfactory = mock(FileTxnSnapLog.class); | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I saw its access to metrics after
unregisterMetrics
. It probably be a good to order it beforeshutdownComponents
, that is assuming it require full functional server components.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The metrics used by the
FileTxnSnapLog
are not "owned" by theZooKeeperServer
, or its children, and not unregistered here, so that shouldn't be a problem.On the other hand, as the parent
ZooKeeperServer
is a dependency of its child classes, I would generally shut down all their components before the parent, and I consider thezkDb
to be owned by the parent in this case, which suggests the current order of shutdown is correct. That said, "shutdown is hard" 😂There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is true that running multiple ZooKeeper instances in one JVM probably be hard. It is false that it unregisters metrics during shutdown.
I am ok to keep it unchanged.