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

jobs: Implement job control for schedules. #52038

Merged
merged 1 commit into from
Jul 31, 2020

Conversation

miretskiy
Copy link
Contributor

Informs #51600

Add a FOR SCHEDULES clause to job control statements
to enable control over jobs created by the scheduled jobs.

PAUSE JOBS FOR SCHEDULE 123
RESUME JOBS FOR SCHEDULES (SELECT schedule_id ....)
CANCEL JOBS FOR SCHEDULE 321

Release Notes (enterprise change): Add FOR SCHEDULES clause to
the job control statements to enable management of the jobs created
by schedules.

@miretskiy miretskiy requested review from dt and spaskob July 28, 2020 22:02
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@miretskiy
Copy link
Contributor Author

@dt @spaskob friendly ping?

Copy link
Contributor

@spaskob spaskob left a comment

Choose a reason for hiding this comment

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

looks good to me but I am not expert on the grammar and parsing. You'd want to include Rapahel on the PR for this.

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

@miretskiy miretskiy requested a review from rohany July 30, 2020 13:44
@miretskiy
Copy link
Contributor Author

@rohany can you pls take a look at this pr wrt to sql stuff?

Copy link
Contributor

@rohany rohany left a comment

Choose a reason for hiding this comment

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

I'm hesitant on this approach to shove the parsed query in an IN clause in the delegate. It's going to give extremely cryptic error messages when something has gone wrong, and will be a hassle if we want to allow non-root users to control certain jobs.

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.

I hear you, @rohany . I've tried different approaches around this; alas, without much success.
Going to discuss this w/ you offline.

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

@rohany
Copy link
Contributor

rohany commented Jul 30, 2020

I discussed with yevgeniy offline, and while I don't like the delegate approach i think that it's fine to do this for now. There is a good amount of work that can be done after this to move to utilizing the optimizer + planNode implementations to do this work and add features (like RETURNING). @miretskiy can you leave some TODO's around here for that?

Add a `FOR SCHEDULES` clause to job control statements
to enable control over jobs created by the scheduled jobs.

```
PAUSE JOBS FOR SCHEDULE 123
RESUME JOBS FOR SCHEDULES (SELECT schedule_id ....)
CANCEL JOBS FOR SCHEDULE 321
```

Release Notes (enterprise change): Add `FOR SCHEDULES` clause to
the job control statements to enable management of the jobs created
by schedules.
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.

TODO comments added to the delegate implementation. @rohany, ptal.

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

@miretskiy
Copy link
Contributor Author

bors r+

@craig
Copy link
Contributor

craig bot commented Jul 31, 2020

Build succeeded:

@craig craig bot merged commit 1e80be9 into cockroachdb:master Jul 31, 2020
@miretskiy miretskiy deleted the schedule_control 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.

4 participants