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
backupccl: skip backing up excluded spans #108627
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
thinking about how to test this (inspect traces vs installing a kvrequest filter) but putting the diff up in the meantime |
91d1a08
to
b4d4e96
Compare
test added |
@@ -9494,6 +9508,11 @@ func TestExcludeDataFromBackupAndRestore(t *testing.T) { | |||
restoreDB.Exec(t, `RESTORE DATABASE data FROM LATEST IN $1`, localFoo) | |||
require.Len(t, restoreDB.QueryStr(t, `SELECT * FROM data.foo`), 0) | |||
require.Len(t, restoreDB.QueryStr(t, `SELECT * FROM data.bar`), 10) | |||
|
|||
before := atomic.LoadInt64(&exportReqsAtomic) |
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.
so at this point data.foo is going to be empty as asserted above. Can we add a few rows to it before attempt a backup.
Also s/BACKUP TO
/BACKUP INTO
/g
Previously we sent export requests to all spans being backed up. The ranges for spans of tables that had set the flag to exclude data from backup would reply with an empty response, excluding their data, but the backup process still sent these ranges these requests. This changes the backup process to not send requests for spans from excluded tables, when performing database, table, or cluster backups. Backups of tenants will still send export requests to every range for the tenant span, and those ranges that host tables that are excluded will continue to reply with no data. This is done both as an optimization, and so that backups can succeed even when a table is unavailable, if, and only if, that table is excluded. Release note (ops change): BACKUP now skips contacting the ranges for tables on which exclude_data_from_backup is set, and can thus succeed even if an excluded table is unavailable. Epic: none.
b4d4e96
to
c5219e3
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.
LGTM, if you have to push again then the last backup can be switched from to to into
TFTRs! bors r+ |
Build failed (retrying...): |
Build succeeded: |
Previously we sent export requests to all spans being backed up. The ranges for spans of tables that had set the flag to exclude data from backup would reply with an empty response, excluding their data, but the backup process still sent these ranges these requests.
This changes the backup process to not send requests for spans from excluded tables, when performing database, table, or cluster backups. Backups of tenants will still send export requests to every range for the tenant span, and those ranges that host tables that are excluded will continue to reply with no data.
This is done both as an optimization, and so that backups can succeed even when a table is unavailable, if, and only if, that table is excluded.
Release note (ops change): BACKUP now skips contacting the ranges for tables on which exclude_data_from_backup is set, and can thus succeed even if an excluded table is unavailable.
Epic: none.