-
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
sqlutil: remove QueryWithCols in favor of QueryRowExWithCols #60572
Conversation
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 (waiting on @yuzefovich)
pkg/jobs/job_scheduler.go, line 307 at r1 (raw file):
// The loop below might encounter an error after some schedules have been // executed (i.e. previous iterations succeeded), and this is ok. // TODO(yuzefovich): confirm with Yevgeniy.
Yup. Should be fine. Each schedule executed under savepoint to guard against errors in schedule
planning/execution.
This commit refactors all usages of `sqlutil.InternalExecutor.QueryWithCols` method in favor of newly added `QueryRowExWithCols` since in almost all places where the former was used, we expected exactly one row. The only noticeable change is the refactor of `jobScheduler.executeSchedules` where we now use the iterator pattern. The difference there is that now it is possible to execute some schedules before encountering an error on the iterator (previously, we would buffer up all rows first), but this change is acceptable because each schedule is executed under savepoint to guard against errors in schedule planning/execution. Release note: None
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.
TFTR!
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @miretskiy)
pkg/jobs/job_scheduler.go, line 307 at r1 (raw file):
Previously, miretskiy (Yevgeniy Miretskiy) wrote…
Yup. Should be fine. Each schedule executed under savepoint to guard against errors in schedule
planning/execution.
👍
bors r- Forgot to update PR description. |
Canceled. |
bors r+ |
Build succeeded: |
This commit refactors all usages of
sqlutil.InternalExecutor.QueryWithCols
method in favor of newly addedQueryRowExWithCols
since in almost all places where the former wasused, we expected exactly one row. The only noticeable change is the
refactor of
jobScheduler.executeSchedules
where we now use theiterator pattern. The difference there is that now it is possible to
execute some schedules before encountering an error on the iterator
(previously, we would buffer up all rows first), but this change is
acceptable because each schedule is executed under savepoint to guard
against errors in schedule planning/execution.
Addresses: #48595.
Release note: None