-
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
cdc: Test for falling behind schema TTL #31020
Conversation
25dd012
to
fe51cfc
Compare
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! 0 of 0 LGTMs obtained (and 1 stale)
pkg/ccl/changefeedccl/helpers_test.go, line 706 at r1 (raw file):
sqlDB *sqlutils.SQLRunner, database, table string, ) {
probably want a t.Helper() at the beginning of this
pkg/ccl/changefeedccl/helpers_test.go, line 711 at r1 (raw file):
stmt = `ALTER DATABASE system CONFIGURE ZONE USING gc.ttlseconds = $1` } else { fmt.Sprintf(`ALTER TABLE %s.%s CONFIGURE ZONE USING gc.ttlseconds = $1`, database, table)
the result of this Sprintf call seems unused
be8f460
to
a006390
Compare
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! 0 of 0 LGTMs obtained (and 1 stale)
pkg/ccl/changefeedccl/helpers_test.go, line 706 at r1 (raw file):
Previously, danhhz (Daniel Harrison) wrote…
probably want a t.Helper() at the beginning of this
Done.
pkg/ccl/changefeedccl/helpers_test.go, line 711 at r1 (raw file):
Previously, danhhz (Daniel Harrison) wrote…
the result of this Sprintf call seems unused
You're correct, and so is the linter/failing tests.
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! 0 of 0 LGTMs obtained (and 1 stale)
pkg/ccl/changefeedccl/helpers_test.go, line 711 at r1 (raw file):
Previously, mrtracy (Matt Tracy) wrote…
You're correct, and so is the linter/failing tests.
Done.
I believe the change to store.go to run a GC is unnecessary. See TestIndexBackfillAfterGC |
Hah, thanks Vivek, wish I had found that earlier! I did not think to look for a request, I was only looking for test hooks. This actually means the tests do not need the sleep at all, that's 4 total seconds of test time back. Nice! Finishing up the change now. |
a006390
to
a504908
Compare
Add a test that ensures that changefeeds properly exit if they fall far enough behind that schema information has been lost due to the GC TTL (that is, a historical row version can no longer be read because the schema at its timestamp has been garbage collected). I have also discovered why the sister test (for the table TTL, not the schema) required a 3 second sleep: the GC queue enforces that replicas must have an appropriately high "score" before being GCed, even when the "shouldQueue" process is skipped. I have swapped to using the "ManuallyEnqueue" method to force the GC, and instead use the already existing GCRequest request type to force a GC of the table; as a result the tests no longer require any sleep. Resolves cockroachdb#28644 Release note: None
a504908
to
4cab780
Compare
bors r=danhhz |
30566: sql: asynchronously drop non-interleaved indexes r=eriktrinh a=eriktrinh This change drops non-interleaved indexes asynchronously by performing the deletion of data using an asynchronous schema changer. This is in preparation to eventually remove index data using `ClearRange` after the GC TTL period has passed. The initial schema changer runs through the state machine but does not perform the deletion of index data. Instead the mutation is moved to a separate list and has a timestamp attached. The created asynchronous schema changer uses the timestamp and index's configured GC TTL value to determine when it should begin execution and actually truncate the index. When the async schema changer deletes the index data two things occur: the job is marked as succeeded and the index zone config is removed. The job can immediately be marked as succeeded because currently a separate job is created for each index that is dropped. Interleaved indexes are unaffected and have their data deleted immediately. Related to #20696 Fixes #28859. 31020: cdc: Test for falling behind schema TTL r=danhhz a=mrtracy Add a test that ensures that changefeeds properly exit if they fall far enough behind that schema information has been lost due to the GC TTL (that is, a historical row version can no longer be read because the schema at its timestamp has been garbage collected). I have also discovered why the sister test (for the table TTL, not the schema) required a 3 second sleep: the GC queue enforces that replicas must have an appropriately high "score" before being GCed, even when the "shouldQueue" process is skipped. To get around this, I have changed "ManuallyEnqueueSpan" to a more explicit "ManuallyGCSpan", which directly calls the processing implementation of the gcQueue on the appropriate replicas. Both that sister test, and the new schema TTL test, now only require a more predictable 1 second sleep. Resolves #28644 Release note: None 31152: changefeedccl: fix TestAvroSchema/DECIMAL flake r=mrtracy a=danhhz The precision is really meant to be in [1,10], but it sure looks like there's an off by one error in the avro library that makes this test flake if it picks precision of 1. Release note: None 31154: kubernetes: Add multiregion channel, add channel to daemonset configs r=a-robinson a=a-robinson Release note: None Fixes #31144 Co-authored-by: Erik Trinh <[email protected]> Co-authored-by: Matt Tracy <[email protected]> Co-authored-by: Daniel Harrison <[email protected]> Co-authored-by: Alex Robinson <[email protected]>
Build succeeded |
Add a test that ensures that changefeeds properly exit if they fall far
enough behind that schema information has been lost due to the GC TTL
(that is, a historical row version can no longer be read because the
schema at its timestamp has been garbage collected).
I have also discovered why the sister test (for the table TTL, not the
schema) required a 3 second sleep: the GC queue enforces that replicas
must have an appropriately high "score" before being GCed, even when the
"shouldQueue" process is skipped. To get around this, I have changed
"ManuallyEnqueueSpan" to a more explicit "ManuallyGCSpan", which
directly calls the processing implementation of the gcQueue on the
appropriate replicas. Both that sister test, and the new schema TTL
test, now only require a more predictable 1 second sleep.
Resolves #28644
Release note: None