Skip to content

Conversation

AhmedSoliman
Copy link
Contributor

@AhmedSoliman AhmedSoliman commented Jun 24, 2025

This fixes a bug where restate v1.4.0 would fail to deserialize old invoker effects from bifrost.

Example error:

2025-06-24T10:51:30.432763Z ERROR run: restate_types::storage::decode: Flexbuffers error at field command.InvokerEffect.kind.JournalEntryV2.entry.inner.Command.command_specific_metadata.CallOrSend err=command.InvokerEffect.kind.JournalEntryV2.entry.inner.Command.command_specific_metadata.CallOrSend: Serde Error: missing field `journal_retention_duration` partition_id=5
2025-06-24T10:51:30.432772Z ERROR run: restate_wal_protocol::envelope: FlexbuffersSerde decode failure (decoding Envelope) err=decoding failed: Serde Error: missing field `journal_retention_duration` partition_id=5
2025-06-24T10:51:30.432788Z  WARN run: restate_worker::partition: Shutting partition processor down because of error: decoding failed: Serde Error: missing field `journal_retention_duration` partition_id=5

@AhmedSoliman AhmedSoliman marked this pull request as ready for review June 24, 2025 12:22
This fixes a bug where restate v1.4.0 would fail to deserialize old invoker effects from bifrost.

Example error:
```
2025-06-24T10:51:30.432763Z ERROR run: restate_types::storage::decode: Flexbuffers error at field command.InvokerEffect.kind.JournalEntryV2.entry.inner.Command.command_specific_metadata.CallOrSend err=command.InvokerEffect.kind.JournalEntryV2.entry.inner.Command.command_specific_metadata.CallOrSend: Serde Error: missing field `journal_retention_duration` partition_id=5
2025-06-24T10:51:30.432772Z ERROR run: restate_wal_protocol::envelope: FlexbuffersSerde decode failure (decoding Envelope) err=decoding failed: Serde Error: missing field `journal_retention_duration` partition_id=5
2025-06-24T10:51:30.432788Z  WARN run: restate_worker::partition: Shutting partition processor down because of error: decoding failed: Serde Error: missing field `journal_retention_duration` partition_id=5
```
@AhmedSoliman AhmedSoliman changed the title Default journal_retention to zero when reading old invoker effects [fix] Default journal_retention to zero when reading old invoker effects Jun 24, 2025
@AhmedSoliman AhmedSoliman requested review from tillrohrmann, slinkydeveloper and pcholakov and removed request for tillrohrmann June 24, 2025 12:24
Copy link

github-actions bot commented Jun 24, 2025

Test Results

  7 files  ±0    7 suites  ±0   5m 2s ⏱️ +8s
 54 tests ±0   53 ✅ ±0  1 💤 ±0  0 ❌ ±0 
223 runs  ±0  220 ✅ ±0  3 💤 ±0  0 ❌ ±0 

Results for commit c8a2cd0. ± Comparison against base commit a847adb.

♻️ This comment has been updated with latest results.

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 a lot for fixing this problem @AhmedSoliman. Defaulting to a 0 duration should be correct. LGTM. +1 for merging.

@AhmedSoliman AhmedSoliman merged commit c1f9c6e into main Jun 24, 2025
27 checks passed
@AhmedSoliman AhmedSoliman deleted the pr3451 branch June 24, 2025 14:11
@github-actions github-actions bot locked and limited conversation to collaborators Jun 24, 2025
@@ -175,6 +175,9 @@ pub struct CallOrSendMetadata {
pub invocation_target: InvocationTarget,
pub span_context: ServiceInvocationSpanContext,
pub completion_retention_duration: Duration,
// Since v1.4.0. Messages older than v1.4.0 will have zero retention as that
// matches the default behaviour of <= 1.3.x.
#[serde(default)]
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 also needs skip_serializing_if zero?

Copy link
Contributor

Choose a reason for hiding this comment

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

Flexbuffer serialization should skip unknown fields if I am not mistaken so for this specific encoding format it might not be needed.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants