-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
rangefeed: fix panic due to rangefeed stopper race
This patch fixes a race condition that could cause an `unexpected Stopped processor` panic if a rangefeed registration was attempted while a store was stopping. Registering a rangefeed panics if a newly created rangefeed processor is unexpectedly stopped and the store's stopper is not quiescing. However, the stopper has two distinct states that it transitions through: stopping and quiescing. It's possible for the processor to fail to start because the stopper is stopping, but before the stopper has transitioned to quiescing, which would trigger this panic. This patch propagates the processor startup error to the rangefeed registration and through to the caller, returning before attempting the registration at all and avoiding the panic. This was confirmed with 50000 stress runs of `TestPGTest/pgjdbc`, all of which succeeded. Release note (bug fix): Fixed a race condition that in rare circumstances could cause a node to panic with `unexpected Stopped processor` during shutdown.
- Loading branch information
1 parent
0bb1218
commit 3d1281a
Showing
3 changed files
with
28 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
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