forked from cockroachdb/cockroach
-
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.
spanconfigkvsubscriber,kvserver: fix KVSubscriber bug
We had a bug in the KVSubscriber where we were invoking a copy of the handler instead of the handler stored. This meant that we'd never treat handlers as "initialized". As a result, we would always invoke them with the everything span, and as a result, visit all replicas on the stores in reaction to span config updates. See datadriven test diffs for an illustration. Fixing the above lead to unearthing an interesting bug in how we were deciding to enqueue replicas in the split queue. Previously, if we received a span config update that implied a split and the update corresponded to the right-hand side post split, we would skip enqueuing the replica in the split queue. The assumption was that we'd get an update corresponding to the LHS of the split for the same replica and that update would enqueue the replica. This doesn't always hold true though. For example, consider the case when a new table is created and must be split from its (left) adjacent table's range. This only results in a single update, corresponding to the new table's span, which is the right-hand side post split. This patch moves to nudging the split queue for all updates, not just left-hand side updates, for the reason above. Release note: None Release justification: bug fixes in new functionality
- Loading branch information
1 parent
4fa089a
commit 9fbf507
Showing
6 changed files
with
39 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,7 +40,6 @@ delete [d,f) | |
|
||
updates | ||
---- | ||
[/Min,/Max) | ||
[d,f) | ||
|
||
store-reader key=d | ||
|
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 |
---|---|---|
|
@@ -75,7 +75,6 @@ upsert [a,c):C | |
|
||
updates | ||
---- | ||
[/Min,/Max) | ||
[a,c) | ||
|
||
store-reader key=a | ||
|
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