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

bulkio: Make incremental scheduled backup wait for full backup. #52836

Merged
merged 1 commit into from
Aug 19, 2020

Conversation

miretskiy
Copy link
Contributor

Fixes #52835

Add ability to record schedule groups: set of related schedules.
Use this functionality to makean incremental schedule wait
until the full one completes before it begins its execution.

Release Notes: None

@miretskiy miretskiy requested review from dt and a team August 14, 2020 20:00
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@miretskiy miretskiy force-pushed the dep_schedule branch 3 times, most recently from d0f863b to 0b6e01b Compare August 18, 2020 13:57
@miretskiy
Copy link
Contributor Author

@dt -- rebased on master; ready for review

Copy link
Member

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm. I donno, this might just be me losing my marbles after staring at too much code, so feel free to just say so, but on first read, I'm about dubious of introducing new concepts like "ScheduleGroup" and "GroupAction". Again, might be just me, but I find the it is a bit harder to grok with the new concepts. Or, alternatively, I expect them to be actual rows in a table called schedule_groups and then to have a group_id column in schedules or whatever. I also don't know that GroupAction is really general to all schedule types?

Thus, my counterproposal would be:

  1. the backup specific ScheduledBackupExecutionArgs gains a "optional int64 unpause_on_success` field
  2. the success hook for backups looks at it and, if it is set: a) unpauses the schedule with that ID b) clears it from itself.

WDYT?

ctx,
"lookup-schedule-info",
txn,
sqlbase.InternalExecutorSessionDataOverride{User: security.RootUser},
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this should probably be NodeUser

if err != nil {
return err
}
inc.Pause("Waiting for FULL")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Waiting for initial backup to complete"

@miretskiy miretskiy requested a review from dt August 19, 2020 09:54
Copy link
Contributor Author

@miretskiy miretskiy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure -- that makes sense. I had something like this going -- notify success is a bit tricky w/ jobs; and initially, I was having issues w/ doing it in the resumer and kinda got on a path of doing it through "meta" proto... Eventually, backup resumer on success started working fine - so making these changes backup specific is fine by me.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @dt)


pkg/ccl/backupccl/backup_job.go, line 590 at r1 (raw file):

Previously, dt (David Taylor) wrote…

this should probably be NodeUser

Done.


pkg/ccl/backupccl/create_scheduled_backup.go, line 341 at r1 (raw file):

Previously, dt (David Taylor) wrote…

"Waiting for initial backup to complete"

Done.

Copy link
Member

@dt dt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like you picked up the go 1.14 proto diff

@miretskiy
Copy link
Contributor Author

miretskiy commented Aug 19, 2020 via email

Add ability to record schedule groups: set of related schedules.
Use this functionality to makean incremental schedule wait
until the full one completes before it begins its execution.

Release Notes: None
@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Aug 19, 2020

Build succeeded:

@craig craig bot merged commit 51b0af4 into cockroachdb:master Aug 19, 2020
@miretskiy miretskiy deleted the dep_schedule branch April 22, 2021 16:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bulkio: Wait for full backup before executing incremental schedule
3 participants