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

Move scheduling of delayed ServiceInvocations from caller PP to callee PP. #1306

Merged
merged 6 commits into from
Mar 27, 2024

Conversation

slinkydeveloper
Copy link
Contributor

Fix #1292

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for creating this PR @slinkydeveloper. The changes look good to me modulo the additional round of replication which we should try to avoid. Once this has been fixed, +1 for merging :-)

// Remove the execution time from the service invocation request
service_invocation.execution_time = None;

// TODO(optimization) we could skip the outbox here and re-propose this to self.
Copy link
Contributor

@tillrohrmann tillrohrmann Mar 25, 2024

Choose a reason for hiding this comment

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

I think it would make sense to do this "optimization". Otherwise, we are adding an additional replication round for delayed calls which is not strictly necessary but a regression compared to before. I think we don't need to re-propose to ourselves if the service_invocation is targeted to ourselves. Instead, we can directly call handle_invoke and be done with it.

Copy link
Contributor

Choose a reason for hiding this comment

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

Technically, this (skipping the outbox for self-targeted messages) could also apply to immediate background calls or calls.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

could also apply to immediate background calls or calls.

Immediate you mean execution_time is past now?

Copy link
Contributor

Choose a reason for hiding this comment

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

With immediate I meant non-delayed invocations (invoke_time == 0).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Isn't this PR already covering it?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

When getting a journal entry for a call/background call we go through the outbox because we don't know if the current PP owns the invocation or not, this PR did not change that. Perhaps an optimization is worth implementing anyway, indipendently from this PR?

@slinkydeveloper
Copy link
Contributor Author

@tillrohrmann I asked your review again as I simplified the storage format + optimized the timer handling, where now we don't go through the outbox anymore.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

Thanks for updating this PR @slinkydeveloper. I left two comments which we should resolve before merging.

Copy link
Contributor

@tillrohrmann tillrohrmann left a comment

Choose a reason for hiding this comment

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

LGTM. +1 for merging.

@slinkydeveloper slinkydeveloper merged commit 21a407f into restatedev:main Mar 27, 2024
3 checks passed
@slinkydeveloper slinkydeveloper deleted the issues/1292 branch March 27, 2024 09:31
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.

Schedule delayed invocations on the target partition processor
2 participants