-
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
…75871 58261: opt,sql: use paired-joins with non-covering indexes for left joins r=rytaft a=sumeerbhola This is done when the left outer/semi/anti join can use a lookup join. Prior to this, when the non-covering index could not fully evaluate the filter for left join we could not generate a lookup join. With this change: - Left outer join becomes a pair of two left outer joins. - Left semi join is a pair of inner join followed by left semi join. - Left anti join is a pair of left outer join followed by left anti join. Informs #55452 Release note (performance improvement): The optimizer can now generate lookup joins in certain cases for non-covering indexes, when performing a left outer/semi/anti join. 75746: dev: initialize submodules in `dev doctor` r=aayushshah15 a=aayushshah15 This commit adds a check to `dev doctor` to initialize submodules, like we do in our `Makefile`. Fixes #72247 Release note: None 75766: server: do not check decommission list for the tenant r=JeffSwenson a=JeffSwenson Previously, the system tenant would return PermissionDenied if the tenant's instance_id was equivalent to a decommissioned node's id. Now, the system tenant does not check the decommissioned node list if the incoming node_id belongs to a non-system tenant. This PR feeds the request context down to the OnOutgoingPing and OnIncomingPing callbacks. Previously the callbacks were using the ambient context. The only use of the context was a storage.MVCCGet call in nodeTombstoneStorage.IsDecommissioned. Release note: None 75804: sql: support RESET ALL statement r=otan a=rafiss fixes #75435 Release note (sql change): Support for the RESET ALL statement was added. This statement resets the values of all session variables to their default values. 75822: sql: error when setting timezone outside of postgres max utc offsets r=otan a=RichardJCai Release note (sql change): Previously, users would be able to set a UTC timezone offset of greater than 167 or less than -167. This now returns an error. Example: SET TIME ZONE '168' Gives error: invalid value for parameter "timezone": "'168'": cannot find time zone "168": UTC timezone offset is out of range. SET TIME ZONE '-168' Gives error: invalid value for parameter "timezone": "'-168'": cannot find time zone "-168": UTC timezone offset is out of range. Fixes #75168 Note: If a user has already set a UTC timezone offset outside of these bounds, it will be unchanged. 75843: c-deps/krb5: fix build for more recent versions of autoconf r=otan a=nicktrav More recent versions of `autoconf`, when used to build `krb5`, generates shell scripts with invalid syntax. Fix by pulling in the [upstream patch][1] for the issue into our tree. Closes #72529. [1]: krb5/krb5@f78edbe 75845: vendor: bump Pebble to 38b68e17aa97 r=jbowens a=nicktrav Pebble commits: ``` 38b68e17 internal/batchskl: return error on index overflow 8440f290 internal/manifest: use a line sweep to optimize NewL0Sublevels 0f5acb26 sstable: add direct block reading to suffix rewriter 26856d10 db: avoid stats flake in TestMemTableReservation b452808f sstable: Make sstable Writer.Close idempotent 17fe1a65 sstable: add RewriteKeySuffixes function c9e6edfc db: expose metrics on count and earliest seqnum of snapshots b958d9a7 sstable: add a writeQueue to the sstable writer c8dad06c db: disable automatic compactions in `MetricsTest` 015f5e38 internal/rangekey: fix range key iteration bug ``` The commit `38b68e17` contains the fix for #69906. Closes #69906. Release note: none 75857: sql: fix small race in distIndexBackfiller r=adityamaru a=stevendanna This fixes a small race condition in distIndexBackfiller. updateJobDetails calls SetResumeSpansInJob which mutates the ResumeSpanList in the job details. Normally, this is only called from the periodic updater. However, when the testing knob AlwasyUpdateIndexBackfillDetails is set, we also update it on every ProducerMetadata message we get back Release note: None 75865: build: address util.log.logcrash package rename r=knz a=rail After `util.log` was renamed to `util.log.logcrash`, the build system stopped updating the Sentry environment variable properly. Instead of setting it to the release version, it was falling back to the default "development" value. As a result, all Sentry reports went to the development environment bucket. This patch addresses the name change. Release note: None 75871: logictestccl: fix stale issue number in TODO r=arulajmani a=arulajmani We closed #69265 in favour of #70558, and the only remaining work left to address locality aware planning for tenants is captured in #75864. Release note: None Co-authored-by: sumeerbhola <[email protected]> Co-authored-by: Aayush Shah <[email protected]> Co-authored-by: Jeff <[email protected]> Co-authored-by: Rafi Shamim <[email protected]> Co-authored-by: richardjcai <[email protected]> Co-authored-by: Nick Travers <[email protected]> Co-authored-by: Steven Danna <[email protected]> Co-authored-by: Rail Aliiev <[email protected]> Co-authored-by: arulajmani <[email protected]>
- Loading branch information
Showing
46 changed files
with
734 additions
and
281 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 |
---|---|---|
|
@@ -1263,10 +1263,10 @@ def go_deps(): | |
patches = [ | ||
"@cockroach//build/patches:com_github_cockroachdb_pebble.patch", | ||
], | ||
sha256 = "0018bcef357bf7bba06d5e3eb35277709b5fd98ee437924001531fa935d8c76d", | ||
strip_prefix = "github.com/cockroachdb/[email protected]20220126162719-a5c1766b568a", | ||
sha256 = "e411c1b5f5c7d2ef9dc337615de7b51051a182bba9c298f540d74d95d8a8f279", | ||
strip_prefix = "github.com/cockroachdb/[email protected]20220201221612-38b68e17aa97", | ||
urls = [ | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20220126162719-a5c1766b568a.zip", | ||
"https://storage.googleapis.com/cockroach-godeps/gomod/github.com/cockroachdb/pebble/com_github_cockroachdb_pebble-v0.0.0-20220201221612-38b68e17aa97.zip", | ||
], | ||
) | ||
go_repository( | ||
|
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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
reset_session_stmt ::= | ||
'RESET' session_var | ||
| 'RESET' 'SESSION' session_var | ||
| 'RESET_ALL' 'ALL' |
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
2 changes: 1 addition & 1 deletion
2
pkg/ccl/logictestccl/testdata/logic_test/multi_region_query_behavior
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
2 changes: 1 addition & 1 deletion
2
pkg/ccl/logictestccl/testdata/logic_test/regional_by_row_query_behavior
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,77 @@ | ||
// Copyright 2022 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 serverccl | ||
|
||
import ( | ||
"context" | ||
gosql "database/sql" | ||
"testing" | ||
"time" | ||
|
||
"github.com/cockroachdb/cockroach/pkg/base" | ||
"github.com/cockroachdb/cockroach/pkg/kv/kvserver/liveness/livenesspb" | ||
"github.com/cockroachdb/cockroach/pkg/roachpb" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/serverutils" | ||
"github.com/cockroachdb/cockroach/pkg/testutils/skip" | ||
"github.com/cockroachdb/cockroach/pkg/util/leaktest" | ||
"github.com/cockroachdb/cockroach/pkg/util/log" | ||
"github.com/stretchr/testify/require" | ||
) | ||
|
||
func TestTenantWithDecommissionedID(t *testing.T) { | ||
defer leaktest.AfterTest(t)() | ||
defer log.Scope(t).Close(t) | ||
|
||
// This is a regression test for a multi-tenant bug. Each tenant sql server | ||
// is assigned an InstanceID. The InstanceID corresponds to the id column in | ||
// the system.sql_instances table. The sql process sets rpcContext.NodeID = | ||
// InstanceID and PingRequest.NodeID = rpcContext.NodeID. | ||
// | ||
// When a KV node recieves a ping, it checks the NodeID against a | ||
// decommissioned node tombstone list. Until PR #75766, this caused the KV | ||
// node to reject pings from sql servers. The rejected pings would manifest | ||
// as sql connection timeouts. | ||
|
||
skip.UnderStress(t, "decommissioning times out under stress") | ||
|
||
ctx := context.Background() | ||
tc := serverutils.StartNewTestCluster(t, 4, base.TestClusterArgs{}) | ||
defer tc.Stopper().Stop(ctx) | ||
|
||
server := tc.Server(0) | ||
decommissionID := tc.Server(3).NodeID() | ||
require.NoError(t, server.Decommission(ctx, livenesspb.MembershipStatus_DECOMMISSIONING, []roachpb.NodeID{decommissionID})) | ||
require.NoError(t, server.Decommission(ctx, livenesspb.MembershipStatus_DECOMMISSIONED, []roachpb.NodeID{decommissionID})) | ||
|
||
tenantID := serverutils.TestTenantID() | ||
|
||
var tenantSQLServer serverutils.TestTenantInterface | ||
var tenantDB *gosql.DB | ||
for instanceID := 1; instanceID <= int(decommissionID); instanceID++ { | ||
sqlServer, tenant := serverutils.StartTenant(t, server, base.TestTenantArgs{ | ||
TenantID: tenantID, | ||
Existing: instanceID != 1, | ||
// Set a low heartbeat interval. The first heartbeat succeeds | ||
// because the tenant needs to communicate with the kv node to | ||
// determine its instance id. | ||
RPCHeartbeatInterval: time.Millisecond * 5, | ||
}) | ||
if sqlServer.RPCContext().NodeID.Get() == decommissionID { | ||
tenantSQLServer = sqlServer | ||
tenantDB = tenant | ||
} else { | ||
tenant.Close() | ||
} | ||
} | ||
require.NotNil(t, tenantSQLServer) | ||
defer tenantDB.Close() | ||
|
||
_, err := tenantDB.Exec("CREATE ROLE test_user WITH PASSWORD 'password'") | ||
require.NoError(t, err) | ||
} |
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
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.