forked from line/centraldogma
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Improve the robustness of old ZooKeeper log removal (line#1040)
Motivation: `OldLogRemover` in `ZooKeeperCommandExecutor` currently catches a `Throwable` when deleting an old log or its log blocks. However, it has two issues doing so: - It doesn't handle an exception that's raised when reading the metadata of the old log. - `Throwable` is way too wide exception to catch. Catching a `KeeperException` whose code is `NONODE` will be enough. - Note that the failure will only transfer the leadership to other replica, rather than stopping the whole replication process. Modifications: - `OldLogRemover` now catches `KeeperException` whose code is `NONODE` only. - An attempt to read a missing log node's metadata is now handled properly. - Added more detail to the log messages about missing nodes - Split `deleteLog()` into `deleteLog()` and `deleteLogBlock()` Result: - The leadership is not transferred anymore when `OldLogRemover` attempts to retrieve a missing log node's metadata, which is not really a critical issue. - Instead, the leadership will be transferred when an exception occurs not because of a missing node.
- Loading branch information
Showing
1 changed file
with
54 additions
and
15 deletions.
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