-
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
kvserver: Implement zone configuration changes for multi-region simplification #57663
Comments
Hi @ajstorm, please add a C-ategory label to your issue. Check out the label system docs. 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan. |
I was thinking it would supplement it, but feel free to handle any way you want. I looked at #57505 before I created this, and it seemed to focus on the kv aspects of modifying zone config semantics. This issue is meant to fill in the zone config stubs that @otan created in his initial work, as the full 21.1 zone config implementation wasn't yet ready. |
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
59304: config/sql: add global_reads field to ZoneConfig, use for GLOBAL tables r=ajstorm a=nvanbenschoten Closes #57689. This PR 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 The PR then 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 #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. Co-authored-by: Nathan VanBenschoten <[email protected]>
After the introduction of cockroachdb#57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes cockroachdb#57663 Release note: None
After the introduction of cockroachdb#57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes cockroachdb#57663 Release note: None
After the introduction of cockroachdb#57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes cockroachdb#57663 Release note: None
After the introduction of cockroachdb#57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes cockroachdb#57663 Release note: None
After the introduction of cockroachdb#57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes cockroachdb#57663 Release note: None
58436: server: add /api/v2/ tree with auth/pagination, port listSessions endpoint r=itsbilal a=itsbilal This change adds the skeleton for a new API tree that lives in `/api/v2/` in the http listener, and currently reimplements the `/sessions/` endpoint that is also implemented in `/_status/`. The new v2 API tree avoids the need to use GRPC Gateway, as well as cookie-based authentication which is less intuitive and idiomatic for REST APIs. Instead, for authentication, it uses a new session header that needs to be set on every request. As many RPC fan-out APIs use statusServer.iterateNodes, this change implements a pagination-aware method, paginatedIterateNodes, that works on a sorted set of node IDs and arranges results in such a way to be able to return the next `limit` results of an arbitary slice after the `next` cursor passed in. An example of how this works in practice is the new `/api/v2/sessions/` endpoint. A dependency on gorilla/mux is added to be able to pattern-match arguments in the URL. This was already an indirect dependency; now it's a direct dependency of cockroach. TODO that are likely to fall over into future PRs: - API Documentation, need to explore using swagger here. - Porting over remaining /_admin/ and /_status/ APIs, incl. SQL based ones Part of #55947. Release note (api change): Adds a new API tree, in /api/v2/*, currently undocumented, that avoids the use of and cookie-based authentication in favour of sessions in headers, and support for pagination. 58906: sql: improve interface for injecting descriptors into internal executor r=lucy-zhang a=lucy-zhang As part of validating new schema elements (unique indexes, constraints) in the schema changer, we inject in-memory descriptors to be used by the internal executor that are never written to disk. This is currently done by creating an entirely new dummy `descs.Collection` and adding the injected descriptors as uncommitted descriptors, and then setting this collection as the `tcModifier` on the internal executor. Then all subsequent queries using the internal executor, which each get their own child `connExecutor` and `descs.Collection`, will have their collection's uncommitted descriptors replaced by the ones in the dummy collection. This commit introduces the concept of a "synthetic descriptor" to refer to these injected descriptors, and slightly improves the interface in two ways: 1. Instead of creating a new `descs.Collection` to hold synthetic descriptors to copy, we now just use a slice of `catalog.Descriptor`s. 2. Synthetic descriptors are now made explicit in the `descs.Collection` and precede uncommitted descriptors when resolving immutable descriptors. Resolving these descriptors mutably is now illegal and will return an assertion error. This commit doesn't change the fact that the synthetic descriptors to be injected into each query/statement's child `descs.Collection` are set on the internal executor itself. This is still not threadsafe. It would make more sense for these descriptors to be scoped at the level of individual queries. Related to #34304. Release note: None 59258: changefeedccl: Freeze table name to the (optionally fully qualified) statement time name r=[miretskiy] a=HonoreDB Previously, Kafka topics and top-level keys were always derived from the table name in changefeeds. If the table name changed, the feed eventually failed, and if the table name was non-unique across databases, collisions were unavoidable. This PR adds a WITH full_table_name option to changefeeds, and honors it by serializing movr.public.drivers as the statement time name and relying on that. There are probably more things that need to change downstream. Release note (sql change): Added "WITH full_table_name" option to create a changefeed on "movr.public.drivers" instead of "drivers". 59281: sql: prevent DROP SCHEMA CASCADE from droping types with references r=ajwerner a=ajwerner Before this patch, a DROP SCHEMA CASCADE could cause database corruption by dropping types which were referenced by other tables. This would lead to bad errors like: ``` ERROR: object already exists: desc 687: type ID 685 in descriptor not found: descriptor not found SQLSTATE: 42710 ``` And doctor errors like: ``` Table 687: ParentID 50, ParentSchemaID 29, Name 't': type ID 685 in descriptor not found: descriptor not found ``` Fixes #59021. Release note (bug fix): Fixed a bug where `DROP SCHEMA ... CASCADE` could result in types which are referenced being dropped. 59591: sql: hook up multi-region DDL to new zone config attributes r=aayushshah15 a=aayushshah15 After the introduction of #57184, we can constrain voting replicas separately from non-voting replicas using the new attributes `num_voters` and `voter_constraints`. This commit connects our multi-region DDL statements to leverage these new attributes. Broadly speaking, - The existing `constraints` and `num_replicas` fields are set at the database level, to be inherited by table/partition level zone configs. - The new attributes: `num_voters` and `voter_constraints` (along with accompanying `lease_preferences` for these voters) are set at the table/partition level. This brings the implementation of these DDL statements inline with the functional specfication. Fixes #57663 Release note: None 59659: sql: fix bug preventing adding FKs referencing hidden columns r=lucy-zhang a=lucy-zhang The validation query for adding foreign keys had a pointless `SELECT *` on the referenced table that caused hidden columns to be omitted, so attempting to add foreign key constraints referencing hidden columns would fail. This PR fixes the query. Fixes #59582. Release note (bug fix): Fixed a bug preventing foreign key constraints referencing hidden columns (e.g., `rowid`) from being added. Co-authored-by: Bilal Akhtar <[email protected]> Co-authored-by: Lucy Zhang <[email protected]> Co-authored-by: Aaron Zinger <[email protected]> Co-authored-by: Andrew Werner <[email protected]> Co-authored-by: Aayush Shah <[email protected]>
While the code is stubbed in right now, we will need to make more thorough zone configuration changes as part of the multi-region simplification for 20.2. This is a placeholder issue which we can use to complete the work.
The text was updated successfully, but these errors were encountered: