-
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
config/sql: add global_reads field to ZoneConfig, use for GLOBAL tables #59304
config/sql: add global_reads field to ZoneConfig, use for GLOBAL tables #59304
Conversation
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.
Looks great.
Super minor nit: While this doesn't expose the functionality of non-blocking transactions, it does make the fields visible for introspection. As a result, it might warrant a release note as alpha customers could see this field and be confused.
Reviewed 10 of 10 files at r1.
Reviewable status: complete! 0 of 0 LGTMs obtained
That's fair. I'll add one. I also wanted to get your opinion on something. I'm starting to think that Now that we've resolved the implementation dispute of #52745 vs. #39758 (which I need to merge as "rejected"), I'm thinking about stealing some terminology from the original RFC. Specifically, I'm thinking about renaming this field in the zone configs to |
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.
Yes, totally. The one caveat I'd point out with each of those is that (to me at least) both of them imply that they would take a numeric setting. Other names we might want to consider: consistent_local_reads
, fast_consistent_reads
.
Are we only going to allow this to be enabled on GLOBAL
tables (or tables which are manually configured to be in multiple regions)?
Reviewable status: complete! 0 of 0 LGTMs obtained
That's a good point. They do sound numeric. I see where you're going with your two suggestions. My only hesitation to them is that they're introducing new terminology that we don't use elsewhere, so they're harder to pattern match against. Since we tend to use "follower read" instead of "local read" everywhere, how about
I think we're going to allow this to be enabled on tables with manual zone configurations. That may be going against our intention to restrict this to enterprise though. If so, I think we'd ideally block the field for non-enterprise users. But we don't have any precedent for that at the zone config level and adding it seems tough. The easier thing to do would be to simply not route to followers for consistent follower reads in non-enterprise deployments, just like we already don't route to followers for stale follower reads in non-enterprise deployments. |
Closes cockroachdb#57689. This commit adds a new global_reads field to the ZoneConfig struct. global_reads specifies whether transactions operating over the range(s) should be configured to provide non-blocking behavior, meaning that reads can be served consistently from all replicas and do not block on writes. In exchange, writes get pushed into the future and must wait on commit to ensure linearizability. For more, see: https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20200811_non_blocking_txns.md Release note (sql change): A new, unused field called "global_reads" was added to zone configurations. The field does not yet have any effect.
cf12dae
to
c7bbb1e
Compare
Done. I ended up updating this field name to |
This commit enables global_reads for tables with the GLOBAL locality config. global_reads are not yet hooked up in KV because we don't yet have per-range closed timestamp tracking, but this completes the SQL-level work for GLOBAL tables, with the exception of cockroachdb#57663, which will add non-voting replicas (at the database zone config level) for all database regions that don't already have a voting replica. Release note: None
c7bbb1e
to
91fbbca
Compare
TFTR! bors r=ajstorm |
Build succeeded: |
Closes #57689.
This PR adds a new
global_reads
field to theZoneConfig
struct.global_reads
specifies whether transactions operating over the range(s) should be configured to provide non-blocking behavior, meaning that reads can be served consistently from all replicas and do not block on writes. In exchange, writes get pushed into the future and must wait on commit to ensure linearizability. For more, see: https://github.com/cockroachdb/cockroach/blob/master/docs/RFCS/20200811_non_blocking_txns.mdThe PR then enables
global_reads
for tables with theGLOBAL
locality config.global_reads
are not yet hooked up in KV because we don't yet have per-range closed timestamp tracking, but this completes the SQL-level work for GLOBAL tables, with the exception of #57663, which will add non-voting replicas (at the database zone config level) for all database regions that don't already have a voting replica.Release note (sql change): A new, unused field called "global_reads" was added to zone configurations. The field does not yet have any effect.