-
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
protectedts: flip knob to enable multi-tenant PTS in clusters #77478
Conversation
c33bd84
to
a47d177
Compare
@arulajmani most of the test changes were switching over from spans to targets, and waiting for KV to reconcile in some cases. The non-trivial changes were in
|
8956ac3
to
20e666f
Compare
@samiskin @miretskiy I've had to rewrite some of the changefeed PTS tests to fit better with the new system where a PTS record written to the system table isn't enough to check a |
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.
I only have minor/nitty comments, the change looks . Thanks for doing this, it's exciting to see this wired up end to end, with integration tests!
I'll echo your comment from above, the changes to changefeed_test.go
are non-trivial and I'm not too familiar with those tests. It's best to get someone from CDC to sign them off.
Reviewed 26 of 27 files at r1, 3 of 4 files at r2.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @adityamaru, @arulajmani, @dt, @miretskiy, and @samiskin)
pkg/spanconfig/spanconfigptsreader/adapter.go, line 97 at r2 (raw file):
// Now ensure the KVSubscriber is fresh enough. testutils.SucceedsSoon(t, func() error { _, fresh, err := a.GetProtectionTimestamps(ctx, keys.EverythingSpan)
nit: I don't think this matters, does it?
pkg/kv/kvserver/client_replica_test.go, line 3458 at r2 (raw file):
// to the zone configs. // // TODO(adityamaru,arulajmani): Once the protectedts.Cache goes away this test
Do you have thoughts on how we'd change this once the Cache
goes away? What you're doing here (replacing cache freshness by blocking the KVSubscriber to make progress) seems sane. I can't think of how we'd want to change this in the future, but maybe I'm missing something. Mind opening an issue with how you'd like to see this evolve once the Cache goes away? Alternatively, if you're happy with how this test is looking (I am!) then I wouldn't be sad seeing this TODO removed entirely.
pkg/kv/kvserver/client_replica_test.go, line 3597 at r2 (raw file):
} } waitForProtectionAndReadProtectedTimestamps = func(t *testing.T, nodeID roachpb.NodeID,
Mind adding a comment for future us, once "waitForProtectionANdReadProtectedTimestamps" doesn't ring the same bell as it does today?
pkg/kv/kvserver/protectedts/ptcache/cache_test.go, line 283 at r2 (raw file):
p := ptstorage.WithDatabase(ptstorage.New(s.ClusterSettings(), s.InternalExecutor().(sqlutil.InternalExecutor), &protectedts.TestingKnobs{DisableProtectedTimestampForMultiTenant: true}), s.DB())
nit: here, and below, formatting looks a bit off. Maybe:
p := ptstorage.WithDatabase(
ptstorage.New(
s.ClusterSettings(),
s.InternalExecutor().(sqlutil.InternalExecutor),
&protectedts.TestingKnobs{DisableProtectedTimestampForMultiTenant: true},
),
s.DB(),
)
pkg/kv/kvserver/protectedts/ptstorage/storage_test.go, line 676 at r2 (raw file):
s := tc.Server(0) pts := s.ExecutorConfig().(sql.ExecutorConfig).ProtectedTimestampProvider
I noticed in a couple of places we've moved to using the TestCluster
version of these interfaces (protectedts.Storage
in this case) instead of constructing one with passed in testing knobs -- I'm curious if there was a reason for this switch?
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.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @arulajmani, @dt, @miretskiy, and @samiskin)
pkg/spanconfig/spanconfigptsreader/adapter.go, line 97 at r2 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
nit: I don't think this matters, does it?
Does roachpb.Span{}
and keys.EverythingSpan
have the same effect? I was under the impression that by passing in EverythingSpan
we would wait for all the frontier timestamps of the KVSubscribers rangefeed to be this fresh.
pkg/kv/kvserver/client_replica_test.go, line 3458 at r2 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Do you have thoughts on how we'd change this once the
Cache
goes away? What you're doing here (replacing cache freshness by blocking the KVSubscriber to make progress) seems sane. I can't think of how we'd want to change this in the future, but maybe I'm missing something. Mind opening an issue with how you'd like to see this evolve once the Cache goes away? Alternatively, if you're happy with how this test is looking (I am!) then I wouldn't be sad seeing this TODO removed entirely.
This is a stale comment, i rewrote the test a couple of times until i realized we no longer need waitForCacheAfter()
anymore. Removed.
pkg/kv/kvserver/client_replica_test.go, line 3597 at r2 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Mind adding a comment for future us, once "waitForProtectionANdReadProtectedTimestamps" doesn't ring the same bell as it does today?
Done.
pkg/kv/kvserver/protectedts/ptstorage/storage_test.go, line 676 at r2 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
I noticed in a couple of places we've moved to using the
TestCluster
version of these interfaces (protectedts.Storage
in this case) instead of constructing one with passed in testing knobs -- I'm curious if there was a reason for this switch?
I felt that we were anyways spinning up a testcluster with the testing knobs, so didn't make sense to re-init a parallel pts.Storage. I'm unsure what the initial motivation to do that was.
6021b84
to
ebc6b5e
Compare
This change switches the `EnableProtectedTimestampForMultiTenant` testing knob to `DisableProtectedTimestampForMultiTenant`. This means that all tests will now run with the ptpb.Target and spanconfig backed protectedts infrastructure by default. Informs: cockroachdb#73727 Release note: None Release justification: non-production code changes
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.
Changefeed test changes look good!
TFTRs!! bors r=arulajmani,samiskin |
Build succeeded: |
Fix race introduced in cockroachdb#77478. Release justification: non-production code changes Release note: None
77658: colexec: add native support for COALESCE, IF, NULLIF r=yuzefovich a=yuzefovich **colexec: remove no longer used testing knob** Previously, in a test helper method we allowed the fallback to the row-by-row engine. At some point this was needed, but right now all callers don't utilize that ability, so we can easily remove it. Release note: None Release justification: testing only change. **colbuilder: order expressions lexicographically** Release note: None Release justification: low risk cleanup. **colexec: add native support for COALESCE, IF, NULLIF** This commit adds the native vectorized support for `CoalesceExpr`, `IfExpr`, and `NullIfExpr` by planning the equivalent CASE expressions. Namely, for `CoalesceExpr` we do ``` CASE WHEN CoalesceExpr.Exprs[0] IS DISTINCT FROM NULL THEN CoalesceExpr.Exprs[0] WHEN CoalesceExpr.Exprs[1] IS DISTINCT FROM NULL THEN CoalesceExpr.Exprs[1] ... END ``` for `IfExpr` we do ``` CASE WHEN IfExpr.Cond THEN IfExpr.True ELSE IfExpr.Else END ``` and for `NullIfExpr` we do ``` CASE WHEN Expr1 == Expr2 THEN NULL ELSE Expr1 END ``` This commit additionally introduces some unit tests for these newly supported expressions while extracting out some testing facilities from the caseOp tests. Fixes: #66015. Release note: None Release justification: low risk, high benefit change to existing functionality. 77784: dev: `--rewrite` should imply `--ignore-cache` r=irfansharif a=rickystewart If you meant to rewrite again but didn't update any source files, Bazel can reuse the cached results which is confusing. Release justification: Non-production code changes Release note: None 77806: kvserver: fix datarace in TestStrictGCEnforcement r=arulajmani a=arulajmani Fix race introduced in #77478. Release justification: non-production code changes Release note: None Co-authored-by: Yahor Yuzefovich <[email protected]> Co-authored-by: Ricky Stewart <[email protected]> Co-authored-by: arulajmani <[email protected]>
This change switches the
EnableProtectedTimestampForMultiTenant
testing knob to
DisableProtectedTimestampForMultiTenant
. This meansthat all tests and clusters will now run with the ptpb.Target and spanconfig backed
protectedts infrastructure by default.
Informs: #73727
Release note: None
Release justification: high impact change to enable new functionality.