-
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.
Browse files
Browse the repository at this point in the history
101098: kvserver: acquire and switch leases during Raft ticks r=erikgrinaker a=erikgrinaker **kvserver: acquire and switch leases during Raft ticks** This patch eagerly acquires leases, and switches their type when appropriate, during Raft ticks. This avoids incurring lease acquisition latency on the next request to the range. However, it's only effective for unquiesced ranges (which includes all expiration-based ranges), so we retain the corresponding logic in the replicate queue as a fallback, taking effect within 10 minutes or so. Resolves #98433. Epic: none Release note: None **kvserver: eagerly initialize replicas with expiration leases** By default, replicas start out quiesced and only unquiesce in response to range traffic. Since expiration-based leases should not quiesce, and should eagerly acquire leases, this patch eagerly initializes and unquiesces replicas with expiration-based leases when loaded. Touches #98433. Epic: none Release note: None **kvserver: limit concurrent eager lease acquisitions** This patch limits the number of concurrent eager lease acquisitions done by the Raft scheduler to 256 per node (across all stores), configurable via `kv.lease.eager_acquisition_concurrency`. When the limit is reached, further lease acquisition requests are dropped and then retried on the next tick. This only applies to acquisition of expired leases and switching of lease types done by the Raft scheduler, not to lease extensions nor to lease acquisitions driven by client requests. Since expiration leases need to be extended regularly there is little point in throttling them and the cluster must be provisioned to handle them, and client-driven acquisitions are clearly high priority. A more sophisticated policy can be considered later if necessary. Resolves #100426. Epic: none Release note: None 102516: backupccl: support materialized view mutation in restore r=rafiss a=rafiss fixes #101075 Release note (bug fix): Fixed a bug that could prevent RESTORE from working if the backup had a refresh materialized view mutation in it. 103115: docgen: add USING clause to DELETE statement diagram r=yuzefovich a=taroface Add the `USING` clause to the `DELETE` statement diagram. This was implemented in #40963. Epic: none Release note: none Release justification: non-production code change 103143: pg_catalog: use 0 for pg_constraint.conparentid r=rafiss a=rafiss fixes #103135 The Postgres docs say this is: > The corresponding constraint of the parent partitioned table, if this is a constraint on a partition; else zero. Since we don't support partitioning like Postgres, we should always make this zero. This fixes a query that a tool was using to identify foreign key relationships. Release note (bug fix): Stopped using a NULL value for pg_constraint.conparentid. Now the value is hard-coded to 0, since CockroachDB does not support constraints on partitions. 103217: roachtest: fix rust and npgsql blocklists r=rafiss a=rafiss fixes #101724 fixes #102673 backport fixes #102740 backport fixes #101592 Release note: None Co-authored-by: Erik Grinaker <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: Ryan Kuo <[email protected]>
- Loading branch information
Showing
19 changed files
with
515 additions
and
233 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,2 @@ | ||
delete_stmt ::= | ||
( ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) | 'WITH' 'RECURSIVE' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) | ) 'DELETE' 'FROM' ( ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) table_alias_name | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) 'AS' table_alias_name ) opt_using_clause ( ( 'WHERE' a_expr ) | ) ( sort_clause | ) ( limit_clause | ) ( 'RETURNING' target_list | 'RETURNING' 'NOTHING' | ) | ||
( ( 'WITH' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) | 'WITH' 'RECURSIVE' ( ( common_table_expr ) ( ( ',' common_table_expr ) )* ) ) | ) 'DELETE' 'FROM' ( ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) table_alias_name | ( ( 'ONLY' | ) table_name opt_index_flags ( '*' | ) ) 'AS' table_alias_name ) ( 'USING' ( ( table_ref ) ( ( ',' table_ref ) )* ) | ) ( ( 'WHERE' a_expr ) | ) ( sort_clause | ) ( limit_clause | ) ( 'RETURNING' target_list | 'RETURNING' 'NOTHING' | ) |
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
42 changes: 42 additions & 0 deletions
42
pkg/ccl/backupccl/testdata/backup-restore/materialized_view
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 |
---|---|---|
@@ -0,0 +1,42 @@ | ||
# We allow implicit access to non-admin users so that we can test | ||
# with nodelocal. | ||
new-cluster name=s1 allow-implicit-access | ||
---- | ||
|
||
exec-sql | ||
CREATE DATABASE testdb; | ||
USE testdb; | ||
CREATE TABLE testdb.t (a int primary key, b int); | ||
CREATE MATERIALIZED VIEW testdb.mv AS SELECT a, b FROM testdb.t; | ||
INSERT INTO testdb.t (a, b) VALUES (1, 2); | ||
---- | ||
|
||
exec-sql | ||
REFRESH MATERIALIZED VIEW mv; | ||
---- | ||
|
||
exec-sql | ||
INSERT INTO testdb.t (a, b) VALUES (2, 3); | ||
---- | ||
|
||
exec-sql | ||
REFRESH MATERIALIZED VIEW mv; | ||
---- | ||
|
||
exec-sql | ||
BACKUP INTO 'nodelocal://1/test/' | ||
---- | ||
|
||
|
||
new-cluster name=s2 share-io-dir=s1 allow-implicit-access | ||
---- | ||
|
||
exec-sql | ||
RESTORE DATABASE testdb FROM LATEST IN 'nodelocal://1/test/' WITH new_db_name = 'newdb'; | ||
---- | ||
|
||
query-sql | ||
SELECT * FROM newdb.mv; | ||
---- | ||
1 2 | ||
2 3 |
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
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
Oops, something went wrong.