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

InvocationStatus::Inboxed #1334

Conversation

slinkydeveloper
Copy link
Contributor

@slinkydeveloper slinkydeveloper commented Mar 28, 2024

Store the metadata about the inboxed invocation in the invocation status table.

This simplifies a bunch of problems, such as terminating inboxed invocations and the upcoming issue of inboxed idempoten invocations (described in #1326)

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.

I can see this work. So from my side +1.

crates/storage-api/src/invocation_status_table/mod.rs Outdated Show resolved Hide resolved
@slinkydeveloper slinkydeveloper force-pushed the proposal-invocation-status-inboxed branch 3 times, most recently from 55fe2e6 to cb1bcd8 Compare April 2, 2024 11:46
@slinkydeveloper slinkydeveloper changed the title [WIP] Proposal InvocationStatus::Inboxed Proposal InvocationStatus::Inboxed Apr 2, 2024
@slinkydeveloper slinkydeveloper changed the title Proposal InvocationStatus::Inboxed InvocationStatus::Inboxed Apr 2, 2024
@slinkydeveloper slinkydeveloper force-pushed the proposal-invocation-status-inboxed branch from cb1bcd8 to 2c2adb5 Compare April 5, 2024 07:54
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 :-) +1 for merging.

@@ -48,11 +53,11 @@ impl SequenceNumberInboxEntry {
}
pub fn from_invocation(
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe rename into invocation?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer from_invocation to stay consistent with below method from_state_mutation.

Comment on lines -52 to -72
match caller {
Source::Service(caller) => {
row.invoked_by("component");
row.invoked_by_component(&caller.service_id.service_name);
if row.is_invoked_by_id_defined() {
row.invoked_by_id(format_using(output, &caller));
}
}
Source::Ingress => {
row.invoked_by("ingress");
}
Source::Internal => {
row.invoked_by("restate");
}
}
if row.is_trace_id_defined() {
let tid = span_context.trace_id();
if tid != TraceId::INVALID {
row.trace_id(format_using(output, &tid));
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

How will removing these columns affect the CLI?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The CLI won't need to query the sys_inbox table anymore now. I defer those changes to followups.

Comment on lines +421 to +422
let inboxed_status =
state_storage.get_invocation_status(&invocation_id).await?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this is one of the additional reads we are introducing by having the InvocationStatus::Inboxed.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

this is the only one i think

@slinkydeveloper slinkydeveloper force-pushed the proposal-invocation-status-inboxed branch from 727a7d6 to 40e9dfd Compare April 5, 2024 15:18
@slinkydeveloper slinkydeveloper merged commit 8228619 into restatedev:main Apr 5, 2024
2 checks passed
@slinkydeveloper slinkydeveloper deleted the proposal-invocation-status-inboxed branch April 5, 2024 15:24
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.

2 participants