-
Notifications
You must be signed in to change notification settings - Fork 11
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
Add prioritizedStages for duchy claimTask #1673
Conversation
dd3cb1c
to
8c76292
Compare
8c76292
to
6190289
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.
Reviewed 18 of 18 files at r1, all commit messages.
Reviewable status: all files reviewed, 3 unresolved discussions (waiting on @renjiezh)
src/main/kotlin/org/wfanet/measurement/duchy/db/computation/ComputationsDatabase.kt
line 130 at r1 (raw file):
ownerId: String, lockDuration: Duration, prioritizedStages: List<StageT> = listOf(),
nit: document the new param
src/main/kotlin/org/wfanet/measurement/duchy/deploy/common/postgres/readers/ComputationReader.kt
line 376 at r1 (raw file):
""" } else { // Binding list of String into the IN clause does not work as expected with r2dbc library.
Direct string replacement is unsafe. You should still always use binding. The way to do it with r2dbc-postgres is unfortunately having to dynamically add the right number of parameters. Luckily, Tristan created ValuesListBoundStatement to help do that for you.
src/main/kotlin/org/wfanet/measurement/duchy/deploy/gcloud/spanner/computation/UnclaimedTasksQuery.kt
line 28 at r1 (raw file):
class UnclaimedTasksQuery<StageT>( protocol: Long, prioritizedStageLongValues: List<Long>,
Generally we want to keep the specific type until the last moment. In this case, converting to Long only when needed. Any reason we can't do that here?
26b9419
to
ba5c885
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.
Reviewable status: 14 of 19 files reviewed, 2 unresolved discussions (waiting on @SanjayVas)
src/main/kotlin/org/wfanet/measurement/duchy/deploy/common/postgres/readers/ComputationReader.kt
line 376 at r1 (raw file):
Previously, SanjayVas (Sanjay Vasandani) wrote…
Direct string replacement is unsafe. You should still always use binding. The way to do it with r2dbc-postgres is unfortunately having to dynamically add the right number of parameters. Luckily, Tristan created ValuesListBoundStatement to help do that for you.
Done.
src/main/kotlin/org/wfanet/measurement/duchy/deploy/gcloud/spanner/computation/UnclaimedTasksQuery.kt
line 28 at r1 (raw file):
Previously, SanjayVas (Sanjay Vasandani) wrote…
Generally we want to keep the specific type until the last moment. In this case, converting to Long only when needed. Any reason we can't do that here?
Done.
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.
Reviewed 5 of 5 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
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.
Can you add a little bit why certain stages need to be prioritized?
Reviewed 6 of 18 files at r1, 2 of 5 files at r2, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
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.
Currently computations are picked up by mills in order of the creation time. A new computation will not be touched before all older computations are complete. It leads to a problem that new computations could keep waiting in initial stage and EDPs are idle. By prioritize computations in initial stage, we can make sure all computations is in fulfillable stage while mills are doing their job.
Linked the github issue.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
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.
Reviewed 8 of 18 files at r1, 3 of 5 files at r2.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
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.
Reviewed 7 of 18 files at r1, 5 of 5 files at r2, 7 of 7 files at r3, all commit messages.
Reviewable status: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)
Issue #1637