-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
spanconfig: support rangefeeds for dynamic system tables #74555
spanconfig: support rangefeeds for dynamic system tables #74555
Conversation
This is "done", but still marking it as draft; it's building on top of 3 open PRs that I'd like to land first. |
a475ea7
to
eb6ff6b
Compare
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.
Code , interesting that the tests are failing in the way that they are. Any ideas what's going on there?
Reviewed 13 of 92 files at r1, 79 of 79 files at r2, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @irfansharif)
Not yet, but thankfully it's contained only to this PR. It'll take some time to munch through, and I'm a bit occupied with the fallout from #73876. I'll let this PR sit on ice for a bit. |
e4bd589
to
3996065
Compare
Fixes cockroachdb#73045. We're running out of system table IDs (see cockroachdb#57531), and as a result we're now introducing the notion of dynamic system IDs throughout the system. Previously KV baked-in the assumption of static system IDs at two points: - When deciding to allow rangefeeds on a given range; - When enforcing strict GC TTL; It did so by decoding the range's key span and comparing against the hard-coded maximum system ID, all to determine whether the range in question contained system tables. If so, we allowed rangefeeds to be declared over it, and also did not enforce strict GC TTL (only really applies to user tables). This way of doing things does not compose with dynamically allocated system table IDs. With arbitrary, possibly non-contiguous IDs, we don't have the convenient key-comparison properties to rely on. To that end, we use the span configs infrastructure to to delegate control of whether rangefeeds are enabled over a given range and whether strict GC is enforced. This scheme allows SQL code to declare "system table configs" over arbitrary schemas, and have KV still respect it. This PR does not expose these span config settings as part of zone configs -- there's no need to (though we could in the future). To account for the asynchronous nature of the span configs infra, we need to ensure that ranges without an available config default to enabling rangefeeds. Release note: None
3996065
to
4b8258c
Compare
TFTR!
Just a few tests that needed updating. bors r+ |
Build failed: |
Now that we're using span configs to control whether rangefeeds are enabled on ranges or not, this test need some additional synchrony (waiting for span configs to be applied). Release note: None
bors r+ |
Build failed: |
This most recent flake looks plausibly legit.
I imagine this could happen if the logical op log was still enabled. bors r- |
Ugh, thanks for flagging. I keep catching new flakes every CI run. |
..TestReplicaRangefeedRetryErrors. - TestProposalOverhead relies on configs applying to the scratch range now that we're using configs to determine whether rangefeeds are enabled or not. We just opt into the right testing knob. - TestReplicaRangefeedRetryErrors creates a split from "underneath" the span configs infra, which previously ended up applying the default config (rangefeed-enabled=true) for the freshly created replicas. This is not what the test wants. Short of rewriting the test, we introduce an interceptor to manually override the replica's span config. Release note: None
d1c6356
to
43a96b3
Compare
Just more tests that needed updating (in appended commits). Will merge on green. |
bors r+ |
Build succeeded: |
\cockroachdb#74555 starts using the span configs infrastructure to control whether rangefeeds are enabled over a given range. Before dynamic system table IDs (cockroachdb#76003), we used the range's key boundaries to determine whether the range in question was for a system table ID. In mixed-version clusters, it's possible to have both forms of this check. To ensure things work in this form (something we suspected in cockroachdb#76331), we add a test. NB: The reason things still work is because in cockroachdb#74555 we modified the system config span to hard code the relevant config fields for constant system table IDs -- behaving identically to previous version nodes. Release note: None
\cockroachdb#74555 starts using the span configs infrastructure to control whether rangefeeds are enabled over a given range. Before dynamic system table IDs (cockroachdb#76003), we used the range's key boundaries to determine whether the range in question was for a system table ID. In mixed-version clusters, it's possible to have both forms of this check. To ensure things work in this form (something we suspected in cockroachdb#76331), we add a test. NB: The reason things still work is because in cockroachdb#74555 we modified the system config span to hard code the relevant config fields for constant system table IDs -- behaving identically to previous version nodes. Release note: None
76466: spanconfig: verify migration for rangefeed enablement r=irfansharif a=irfansharif \#74555 starts using the span configs infrastructure to control whether rangefeeds are enabled over a given range. Before dynamic system table IDs (#76003), we used the range's key boundaries to determine whether the range in question was for a system table ID. In mixed-version clusters, it's possible to have both forms of this check. To ensure things work in this form (something we suspected in #76331), we add a test. NB: The reason things still work is because in #74555 we modified the system config span to hard code the relevant config fields for constant system table IDs -- behaving identically to previous version nodes. Release note: None Co-authored-by: irfan sharif <[email protected]>
\#74555 starts using the span configs infrastructure to control whether rangefeeds are enabled over a given range. Before dynamic system table IDs (#76003), we used the range's key boundaries to determine whether the range in question was for a system table ID. In mixed-version clusters, it's possible to have both forms of this check. To ensure things work in this form (something we suspected in #76331), we add a test. NB: The reason things still work is because in #74555 we modified the system config span to hard code the relevant config fields for constant system table IDs -- behaving identically to previous version nodes. Release note: None
\cockroachdb#74555 starts using the span configs infrastructure to control whether rangefeeds are enabled over a given range. Before dynamic system table IDs (cockroachdb#76003), we used the range's key boundaries to determine whether the range in question was for a system table ID. In mixed-version clusters, it's possible to have both forms of this check. To ensure things work in this form (something we suspected in cockroachdb#76331), we add a test. NB: The reason things still work is because in cockroachdb#74555 we modified the system config span to hard code the relevant config fields for constant system table IDs -- behaving identically to previous version nodes. Release note: None
Tracked down one of the regressions in microbenchmark to the first commit here:
Not sure if we can do anything about it. |
Fixes #73045.
We're running out of system table IDs (see #57531), and as a result
we're now introducing the notion of dynamic system IDs throughout the
system. Previously KV baked-in the assumption of static system IDs at
two points:
It did so by decoding the range's key span and comparing against the
hard-coded maximum system ID, all to determine whether the range in
question contained system tables. If so, we allowed rangefeeds to be
declared over it, and also did not enforce strict GC TTL (only really
applies to user tables). This way of doing things does not compose with
dynamically allocated system table IDs. With arbitrary, possibly
non-contiguous IDs, we don't have the convenient key-comparison
properties to rely on.
To that end, we use the span configs infrastructure to to delegate
control of whether rangefeeds are enabled over a given range and whether
strict GC is enforced. This scheme allows SQL code to declare "system
table configs" over arbitrary schemas, and have KV still respect it.
This PR does not expose these span config settings as part of zone
configs -- there's no need to (though we could in the future). To
account for the asynchronous nature of the span configs infra, we need
to ensure that ranges without an available config default to enabling
rangefeeds.
Release note: None