-
Notifications
You must be signed in to change notification settings - Fork 1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#21775] docdb: Avoid segfault on catalog reload / collector call races.
Summary: The existing `GetClusterConfig()` function can segfault if it is called while the catalog manager is reloading the system catalog because the `cluster_config_` field is reset during catalog loading. However it does already return a `Status` object, there is just no codepath that returns a not-OK status. This diff refactors the function to return a `Result` instead, and returns a not-OK status if the `cluster_config_` field is null. Since all clients are already dealing with the returned `Status` object in the old signature, this was a minimal change that makes calls safe, regardless of whether the caller holds the leader lease or not. Jira: DB-10650 Test Plan: Existing tests to be sure the refactor is safe. I didn't add a test that the race is fixed as the race is difficult to expose deterministically. Reviewers: asrivastava, mhaddad, xCluster, hsunder Reviewed By: asrivastava, hsunder Subscribers: ybase, esheng, slingam Differential Revision: https://phorge.dev.yugabyte.com/D34609
- Loading branch information
Showing
16 changed files
with
127 additions
and
122 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
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
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
Oops, something went wrong.