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

Task rewrite: adopt AggregatorTask in datastore #2017

Merged
merged 3 commits into from
Sep 29, 2023

Conversation

tgeoghegan
Copy link
Contributor

@tgeoghegan tgeoghegan commented Sep 28, 2023

Adopts janus_aggregator_core::task::test_util::NewTaskBuilder and janus_aggregator_core::task::AggregatorTask in the janus_aggregator_core::datastore module. Much as the previous change provides two kinds of Task structure, we now provide two sets of methods for reading and writing tasks: one that deals in the new AggregatorTask and the other which deals in the old Task.

We add routines for converting between task::Task and task::AggregatorTask to make it easier for these two paths through the datastore to co-exist. This conversion is lossy because AggregatorTask only retains one of the aggregator endpoints, but this doesn't cause substantial problems in Janus, and we can live it transitionally.

Part of #1524

@tgeoghegan tgeoghegan requested a review from a team as a code owner September 28, 2023 23:11
@tgeoghegan tgeoghegan added the allow-changed-migrations Override the ci-migrations check to allow migrations that have changed. label Sep 28, 2023
Base automatically changed from timg/add-new-task-structs to main September 29, 2023 00:41
Adopts `janus_aggregator_core::task::test_util::NewTaskBuilder` and
`janus_aggregator_core::task::AggregatorTask` in the
`janus_aggregator_core::datastore` module. Much as the previous change
provides two kinds of `Task` structure, we now provide two sets of
methods for reading and writing tasks: one that deals in the new
`AggregatorTask` and the other which deals in the old `Task`.

We add routines for converting between `task::Task` and
`task::AggregatorTask` to make it easier for these two paths through the
datastore to co-exist. This conversion is lossy because `AggregatorTask`
only retains one of the aggregator endpoints, but this doesn't cause
substantial problems in Janus, and we can live it transitionally.

Finally, the SQL schema for tasks is changed so that only the peer
aggregator's endpoint is stored.

Part of #1524
@tgeoghegan tgeoghegan force-pushed the timg/new-task-datastore branch from ea00c96 to 0bf9101 Compare September 29, 2023 00:41
}
}

impl From<AggregatorTask> for Task {
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm cool with this for transitional purposes, but think we should do away with it ASAP (since it's lossy and contains false data). Looks like you're well on your way to doing so though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is going to go away along with janus_aggregator_core::task::Task as this series of PRs progresses.

self.time_precision,
self.tolerable_clock_skew,
self.hpke_keys.values().cloned().collect::<Vec<_>>(),
AggregatorTaskParameters::TaskProvHelper,
Copy link
Contributor

Choose a reason for hiding this comment

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

Elsewhere we've used Taskprov instead of TaskProv (i.e. lowercase P).

Whichever one works for me, but we should be consistent. It also wasn't introduced in this PR so doesn't have to be resolved here. Can proceed, then maybe a PR after the rest that does find | sed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That makes sense. I'm going to change the name in a later PR so that I don't have to rebase the existing stack.

@tgeoghegan tgeoghegan merged commit ef0206a into main Sep 29, 2023
8 checks passed
@tgeoghegan tgeoghegan deleted the timg/new-task-datastore branch September 29, 2023 15:32
tgeoghegan added a commit that referenced this pull request Sep 29, 2023
For consistency with other renderings of "Taskprov". See previous
discussion in [1].

[1]: #2017 (comment)
tgeoghegan added a commit that referenced this pull request Sep 29, 2023
For consistency with other renderings of "Taskprov". See previous
discussion in [1].

[1]: #2017 (comment)
tgeoghegan added a commit that referenced this pull request Sep 29, 2023
For consistency with other renderings of "Taskprov". See previous
discussion in [1].

[1]: #2017 (comment)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
allow-changed-migrations Override the ci-migrations check to allow migrations that have changed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants