Fix InvocationError metadata lost during protobuf deserialization of ResponseResult#4509
Open
tillrohrmann wants to merge 1 commit intorestatedev:mainfrom
Open
Fix InvocationError metadata lost during protobuf deserialization of ResponseResult#4509tillrohrmann wants to merge 1 commit intorestatedev:mainfrom
tillrohrmann wants to merge 1 commit intorestatedev:mainfrom
Conversation
…ResponseResult The TryFrom<ResponseResult> implementation for deserializing a ResponseResult from protobuf storage was constructing an InvocationError with only code and message, silently dropping the failure_metadata field. The serialization direction (From<ResponseResult>) correctly included failure_metadata, so metadata was written to storage but lost on read. This surfaces in multi-node clusters when an idempotent invocation completes on one node and the result is later read back from storage on another. For example, in the threeNodes/UserErrors test: the ingress on N1 submits callTerminallyFailingCall, but partition 0 is reassigned to N3 mid-flight. N3 replays the log, completes the invocation, and persists the completed status (with metadata) to RocksDB. When N1's ingress retries (using the idempotency key), N3's partition processor finds InvocationStatus::Completed in storage and returns the stored response_result — which goes through the buggy TryFrom<ResponseResult> deserialization, stripping the metadata before it reaches the ingress. This fixes restatedev#4508.
de7ee7a to
a480b47
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The TryFrom implementation for deserializing a ResponseResult from protobuf storage was constructing an InvocationError with only code and message, silently dropping the failure_metadata field. The serialization direction (From) correctly included failure_metadata, so metadata was written to storage but lost on read.
This surfaces in multi-node clusters when an idempotent invocation completes on one node and the result is later read back from storage on another. For example, in the threeNodes/UserErrors test: the ingress on N1 submits callTerminallyFailingCall, but partition 0 is reassigned to N3 mid-flight. N3 replays the log, completes the invocation, and persists the completed status (with metadata) to RocksDB. When N1's ingress retries (using the idempotency key), N3's partition processor finds InvocationStatus::Completed in storage and returns the stored response_result — which goes through the buggy TryFrom deserialization, stripping the metadata before it reaches the ingress.
This fixes #4508.