-
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
61214: importccl: avoid random() collisions between KV batches r=pbardea a=pbardea An import may parallelize the work to convert SQL rows into KVs. During this phase, default expressions are evaluated. Previously, IMPORT's implementations of random number generates that are evaluated in default expressions assumed that all of the given row IDs were contiguous. This is not the case since 1 row converter may be responsible for converting several non-contiguous batches of rows. This resulted in random_values colliding between different batches of KV space. This commit fixes this bug by feeding in the current position and resetting the random source backing these methods. This ensures that import treats a new contiguous batch of rows separately. Fixes #61203. Release justification: bug fix Release note (bug fix): Fix a bug where random numbers generated as default expressions during IMPORT would collide a few hundred rows apart from eachother. 61300: sql: set zone configs before backfill on ALTER TABLE LOCALITY/PRIMARY KEY r=arulajmani,ajstorm a=otan Ensure that the zone configurations are correctly set before the backfill runs, so data is backfilled to the correct location upfront for REGIONAL BY ROW tables. Note this bug also exists on existing ALTER PRIMARY KEY statements. Release justification: bug fixes and low-risk updates to new functionality Release note (bug fix): Fix bug where zone configurations on indexes were not copied before the backfill of an ALTER PRIMARY KEY. They used to be copied afterwards instead. 61349: sql: add is_temporary and is_virtual columns to crdb_internal.create_statements r=rafiss a=RichardJCai These columns are useful for filtering for generating output for SHOW CREATE ALL TABLES. Release justification: None, change to internal table. Release note: None 61356: server: fix node decommissioning itself r=knz,tbg a=erikgrinaker Previously, if a node was asked to decommission itself, the decommissioning process would sometimes hang or fail since the node would become decommissioned and lose RPC access to the rest of the cluster while it was building the response. This patch returns an empty response from the `adminServer.Decommission()` call when setting the final `DECOMMISSIONED` status, thereby avoiding further use of cluster RPC after decommissioning itself. It also defers self-decommissioning until the end if multiple nodes are being decommissioned. This change is backwards-compatible with old CLI versions, which will simply output the now-empty status result set before completing with "No more data reported on target nodes". The CLI has been updated to simply omit the empty response. Resolves #56718. A separate commit ensures errors with `codes.PermissionDenied` abort RPC retries and return immediately, to prevent operations hanging with indefinite internal retries when RPC access is lost. Release justification: bug fixes and low-risk updates to new functionality Release note (bug fix): Fixed a bug from 21.1-alpha where a node decommissioning process could sometimes hang or fail when the decommission request was submitted via the node being decommissioned. 61376: opt: prune unnecessary columns in uniqueness checks r=mgartner a=mgartner Projects now wrap semi-joins of unique checks which pass-through the columns of the unique constraint. This allows normalization rules to prune unnecessary columns from the expression. Release justification: This is a low-risk change to new functionality, implicitly partitioned unique indexes. Release note (performance improvement): The columns fetched for uniqueness checks of implicitly partitioned unique indexes are now pruned to only include columns necessary for determining uniqueness. 61410: sql: disallow GRANT/REVOKE on system tables r=RichardJCai a=RichardJCai Disallow GRANT/REVOKE operations on system objects to avoid potential deadlocks related to version bumps. Release justification: bug fix Release note (sql change): Disallow `GRANT/REVOKE` operations on system tables. Release note (bug fix): Fix a bug where `GRANT/REVOKE` on the `system.lease` table would result in a deadlock. Fixes #43842 Picking up PR from here: #53683 It seems like the `system.comments` migration that used the GRANT/REVOKE is gone now (comment here: #53683 (comment)) 61427: geomfn: prevent smaller densifyFrac for ST_{Frechet,Hausdorff}Distance r=rafiss a=otan Release justification: low-risk change to existing functionality Resolves #61367. Release note (sql change): Prevent densifyFracs < 1e-6 for ST_FrechetDistance and ST_HausdorffDistance to protect panics and out of memory errors. Co-authored-by: Paul Bardea <pbardea@gmail.com> Co-authored-by: Oliver Tan <otan@cockroachlabs.com> Co-authored-by: richardjcai <caioftherichard@gmail.com> Co-authored-by: Erik Grinaker <grinaker@cockroachlabs.com> Co-authored-by: Marcus Gartner <marcus@cockroachlabs.com>
- Loading branch information
Showing
47 changed files
with
3,266 additions
and
2,421 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
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
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,51 @@ | ||
// Copyright 2021 The Cockroach Authors. | ||
// | ||
// Licensed as a CockroachDB Enterprise file under the Cockroach Community | ||
// License (the "License"); you may not use this file except in compliance with | ||
// the License. You may obtain a copy of the License at | ||
// | ||
// https://github.com/cockroachdb/cockroach/blob/master/licenses/CCL.txt | ||
|
||
package partitionccl | ||
|
||
import ( | ||
"testing" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/ccl/testutilsccl" | ||
"github.com/cockroachdb/cockroach/pkg/util/leaktest" | ||
"github.com/cockroachdb/cockroach/pkg/util/log" | ||
) | ||
|
||
func TestAlterPrimaryKeyCorrectZoneConfigBeforeBackfill(t *testing.T) { | ||
defer leaktest.AfterTest(t)() | ||
defer log.Scope(t).Close(t) | ||
|
||
testCases := []testutilsccl.AlterPrimaryKeyCorrectZoneConfigTestCase{ | ||
{ | ||
Desc: "ALTER PRIMARY KEY", | ||
SetupQuery: `CREATE TABLE t.test (k INT NOT NULL, v INT NOT NULL, INDEX v_idx (v)); | ||
ALTER INDEX t.test@v_idx CONFIGURE ZONE USING gc.ttlseconds = 888 | ||
`, | ||
AlterQuery: `ALTER TABLE t.test ALTER PRIMARY KEY USING COLUMNS (v)`, | ||
ExpectedIntermediateZoneConfigs: []testutilsccl.AlterPrimaryKeyCorrectZoneConfigIntermediateZoneConfig{ | ||
{ | ||
ShowConfigStatement: `SHOW ZONE CONFIGURATION FOR INDEX t.test@v_idx_rewrite_for_primary_key_change`, | ||
ExpectedTarget: `INDEX t.public.test@v_idx_rewrite_for_primary_key_change`, | ||
ExpectedSQL: `ALTER INDEX t.public.test@v_idx_rewrite_for_primary_key_change CONFIGURE ZONE USING | ||
range_min_bytes = 134217728, | ||
range_max_bytes = 536870912, | ||
gc.ttlseconds = 888, | ||
num_replicas = 1, | ||
constraints = '[]', | ||
lease_preferences = '[]'`, | ||
}, | ||
}, | ||
}, | ||
} | ||
|
||
testutilsccl.AlterPrimaryKeyCorrectZoneConfigTest( | ||
t, | ||
`CREATE DATABASE t`, | ||
testCases, | ||
) | ||
} |
Oops, something went wrong.