Skip to content
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

backup: CREATE SCHEDULE for table backup does not save qualified table name #66450

Closed
dt opened this issue Jun 14, 2021 · 3 comments · Fixed by #69947
Closed

backup: CREATE SCHEDULE for table backup does not save qualified table name #66450

dt opened this issue Jun 14, 2021 · 3 comments · Fixed by #69947
Labels
A-disaster-recovery C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. GA-blocker T-disaster-recovery

Comments

@dt
Copy link
Member

dt commented Jun 14, 2021

CREATE DATABASE mydb; USE mydb; CREATE TABLE mytbl (id int primary key); CREATE SCHEDULE FOR BACKUP mytbl INTO 'userfile:///a' RECURRING '@hourly'

Schedule creation does a dry run backup to see if it will work, which succeeds in this case. But then the backup fails saying the table doesn't exist. This is because the BACKUP is of mytbl but in the background, scheduled job session, that does not resolve to mydb.mytbl.

We should replace the backup that we run with the fully qualified mydb.mytbl name in the serialized backup command.

Epic CRDB-8816

@blathers-crl
Copy link

blathers-crl bot commented Jun 14, 2021

Hi @dt, please add a C-ategory label to your issue. Check out the label system docs.

While you're here, please consider adding an A- label to help keep our repository tidy.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

@dt dt added A-disaster-recovery C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. labels Jun 14, 2021
adityamaru pushed a commit to adityamaru/cockroach that referenced this issue Sep 9, 2021
This change adds logic to fully qualify the table names that are
specified as targets during a scheduled backup. It does this so
that the backup statement that is created and stored during planning
of the scheduled job has FQ table names. This is necessary because
the actual execution of the backup job occurs in a background,
schedueled job session with different resolution configurations.

Fixes: cockroachdb#66450

Release note: None

Release justification: bug fixes and low-risk updates to new functionality
craig bot pushed a commit that referenced this issue Sep 10, 2021
69947: backupccl: fully qualify target tables during scheduled backup r=dt a=adityamaru

This change adds logic to fully qualify the table names that are
specified as targets during a scheduled backup. It does this so
that the backup statement that is created and stored during planning
of the scheduled job has FQ table names. This is necessary because
the actual execution of the backup job occurs in a background,
schedueled job session with different resolution configurations.

Fixes: #66450

Release note: None

Release justification: bug fixes and low-risk updates to new functionality

69983: sql: ensure subzones inherit `global_reads` from parent correctly r=nvanbenschoten a=arulajmani

Previously, an index/partition subzone would not inherit the
`global_reads` attribute correctly from the parent zone. This patch
fixes that.

Closes #69647

Release justification: low-risk bug fix for existing functionality
Release note (bug fix): Fixed a bug where index/partition subzones may
not have inherited the `global_reads` field correctly in some cases
from their parent.

69996: sql: fix sql stats not flushing with default flush interval r=maryliag a=Azhng

Previously, if the sql.stats.flush.interval is not set explicitly
via SQL CLI, the flusher would not function properly. This is because
timer.Reset() method is called in the post-clause in the for-loop,
hence it was not properly initialized.
This commit fixes this issue by properly initializing the timer.

Release note: None

Co-authored-by: Anne Zhu <anne.zhu@cockroachlabs.com>
Co-authored-by: arulajmani <arulajmani@gmail.com>
Co-authored-by: Azhng <archer.xn@gmail.com>
@craig craig bot closed this as completed in b68d37a Sep 10, 2021
@adityamaru
Copy link
Contributor

A result of this bug was that scheduled backups with table targets might fail in older releases. Adding backport labels and a GA Blocker tag to get this into 21.2.

@blathers-crl
Copy link

blathers-crl bot commented Sep 19, 2021

Hi @adityamaru, please add branch-* labels to identify which branch(es) this release-blocker affects.

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is otan.

adityamaru pushed a commit to adityamaru/cockroach that referenced this issue Sep 19, 2021
This change adds logic to fully qualify the table names that are
specified as targets during a scheduled backup. It does this so
that the backup statement that is created and stored during planning
of the scheduled job has FQ table names. This is necessary because
the actual execution of the backup job occurs in a background,
schedueled job session with different resolution configurations.

Fixes: cockroachdb#66450

Release note: None

Release justification: bug fixes and low-risk updates to new functionality
adityamaru pushed a commit to adityamaru/cockroach that referenced this issue Sep 19, 2021
This change adds logic to fully qualify the table names that are
specified as targets during a scheduled backup. It does this so
that the backup statement that is created and stored during planning
of the scheduled job has FQ table names. This is necessary because
the actual execution of the backup job occurs in a background,
schedueled job session with different resolution configurations.

Fixes: cockroachdb#66450

Release note: None

Release justification: bug fixes and low-risk updates to new functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-disaster-recovery C-bug Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior. GA-blocker T-disaster-recovery
Projects
Archived in project
3 participants