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

Defined the DurabilityHost interface and migrated Durability to it #1236

Merged
merged 3 commits into from
Jan 13, 2025

Conversation

vigoo
Copy link
Contributor

@vigoo vigoo commented Jan 13, 2025

Resolves #1223

The primary change is introducing https://github.com/golemcloud/golem/pull/1236/files#diff-bcdc1292ac93ac52e1b1b02d1320cae842ccfa169d1b62a97b5aba1abdc44a4eR49 which is going to be moved to Golem's WIT definitions in the next step.

pub struct PersistedDurableFunctionInvocation {
timestamp: Timestamp,
function_name: String,
response: Vec<u8>,
Copy link
Contributor

Choose a reason for hiding this comment

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

It might make sense to not load the response by default but instead allow streaming them in when needed. I believe we can have quite easily have a situation where response_size > host_memory, especially with streaming responses.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It is not in this level - when persisting a streamed wasi-http response (which I think you have in mind) each chunk read is persisted as a separate oplog entry.
This type is only used in host functions made durable, so basically what they do with it is that they read from the oplog what they otherwise would return when not in replay mode.

It is of course interesting to think of what happens when WASI (and WIT etc) itself will support streams - but to persist functions returning streams will require many changes / improvements anyway.

@vigoo vigoo merged commit 376c1c7 into main Jan 13, 2025
16 of 17 checks passed
@vigoo vigoo deleted the vigoo/durability-host-functions-1 branch January 13, 2025 10:56
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.

Extract a clean set of durability host functions
2 participants