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

Awakeable id format changes #47

Merged
merged 2 commits into from
Aug 18, 2023
Merged

Awakeable id format changes #47

merged 2 commits into from
Aug 18, 2023

Conversation

slinkydeveloper
Copy link
Contributor

Fix #46, fix #22 as well (I was forced to, in order to remove the old fields)

bytes invocation_id = 1;
bytes instance_key = 2;
// Unique id of the invocation. This id is unique across invocations and won't change when replaying the journal.
bytes id = 1;
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 id in the runtime world is partition_key + invocation_id, but in sdk terms it doesn't really matter, this is just what you need to concatenate with the awakeable index.


// Invocation id that can be used for logging.
// The user can use this id to address this invocation in admin and status introspection apis.
string id_debug = 2;
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 used by the SDKs to add info to debug lines. Right now we debug the sid in the SDK, created by composing the previous fields invocation_id and instance_key. With this change, SDKs just need to use this id_debug. Currently, this will be the sid serialized but with restatedev/restate#704 in place this will be the partition key + invocation id as base64

Copy link
Contributor Author

@slinkydeveloper slinkydeveloper Aug 18, 2023

Choose a reason for hiding this comment

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

This also gives us flexibility in future to change the id formats in the way we want, without applying sdk changes anymore (same for above comment). Plus it hides a bit the implementation details.

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.

bytes instance_key = 2;
bytes invocation_id = 3;
uint32 entry_index = 4;
// Identifier of the awakeable. See the spec for more details.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe say that this is the base64 encoded form of the awakeable identifier.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not sure this adds more than what is already described in the spec.

@slinkydeveloper slinkydeveloper merged commit d101d48 into main Aug 18, 2023
2 checks passed
@slinkydeveloper slinkydeveloper deleted the issues/46 branch August 18, 2023 16:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants