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

Add prioritizedStages for duchy claimTask #1673

Merged
merged 3 commits into from
Jul 15, 2024
Merged

Conversation

renjiezh
Copy link
Contributor

@renjiezh renjiezh commented Jun 26, 2024

Issue #1637

@wfa-reviewable
Copy link

This change is Reviewable

@renjiezh renjiezh force-pushed the renjiez-init-state-starvation branch from dd3cb1c to 8c76292 Compare June 27, 2024 03:08
@renjiezh renjiezh force-pushed the renjiez-init-state-starvation branch from 8c76292 to 6190289 Compare June 27, 2024 03:08
@renjiezh renjiezh requested a review from SanjayVas June 27, 2024 03:17
Copy link
Member

@SanjayVas SanjayVas left a 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?

@renjiezh renjiezh force-pushed the renjiez-init-state-starvation branch from 26b9419 to ba5c885 Compare July 10, 2024 18:37
Copy link
Contributor Author

@renjiezh renjiezh left a 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.

Copy link
Member

@SanjayVas SanjayVas left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

Copy link
Collaborator

@stevenwarejones stevenwarejones left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

Copy link
Contributor Author

@renjiezh renjiezh left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

Copy link
Collaborator

@stevenwarejones stevenwarejones left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

@renjiezh renjiezh enabled auto-merge (squash) July 15, 2024 20:39
Copy link
Contributor Author

@renjiezh renjiezh left a 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: :shipit: complete! all files reviewed, all discussions resolved (waiting on @renjiezh)

@renjiezh renjiezh merged commit 72505b5 into main Jul 15, 2024
4 checks passed
@renjiezh renjiezh deleted the renjiez-init-state-starvation branch July 15, 2024 21:01
SanjayVas pushed a commit that referenced this pull request Jul 16, 2024
ple13 pushed a commit that referenced this pull request Aug 16, 2024
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