Skip to content

test(journaling): pin binary journal compatibility - #11466

Closed
ReubenBond wants to merge 1 commit into
dotnet:mainfrom
ReubenBond:rb-journal-format-compatibility
Closed

ReubenBond wants to merge 1 commit into
dotnet:mainfrom
ReubenBond:rb-journal-format-compatibility

Conversation

@ReubenBond

@ReubenBond ReubenBond commented Oct 10, 2026 •

Copy link
Copy Markdown
Member

OrleansBinary journals already persist two supported entry framings: legacy variable-length V0 entries with a command-format byte of 0, and fixed-width V1 entries with a framing marker of 1. The released Microsoft.Orleans.Journaling 10.3.1-alpha.1 package and current main write V1 and recover both formats. Renumbering the fixed-width marker to 0 or removing the legacy reader would reject persisted history.

Preserve the existing readers, markers, command discriminators, serialized operands, and codec snapshots. Add immutable hexadecimal fixtures emitted by the released 10.3.1 package, alongside the existing captured legacy journal. Extend recovery coverage across all seven durable types with present and absent format metadata, one-byte storage reads, byte-for-byte released-format appends, recovery of mixed V0/V1 journals, V1 compaction, and subsequent recovery.

Document the framing/codec contract and correct migration guidance: an absent stored format key selects the configured format, so binary journals with missing metadata are recovered with orleans-binary. Establish the stored binary format key before switching the configured write format.

This is an independent compatibility safeguard extracted from the journal-format review of #10693. It changes tests and documentation only; production formats and public APIs remain unchanged. The fixtures are pinned to their producing versions instead of being regenerated when current writers change.

Microsoft Reviewers: Open in CodeFlow

Copilot AI balanced review requested due to automatic review settings October 10, 2026 16:01

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The migration instructions reference an unspecified format-metadata mechanism instead of an actionable supported procedure.

1 open finding
What changed in this PR

Pins OrleansBinary journal compatibility across legacy V0 and released V1 formats.

Changes:

  • Adds immutable V1 journal and append fixtures.
  • Tests streaming recovery, appends, compaction, and metadata variants.
  • Documents framing and migration requirements.
File Description
test/​Orleans.Journaling.Tests/​UpstreamMainCompatibilityTests.cs Expands compatibility and recovery tests.
test/​Orleans.Journaling.Tests/​fixtures/​UpstreamMainCompatibilityTests.released-10.3.1-v1-journal.hex Adds released V1 journal fixture.
test/​Orleans.Journaling.Tests/​fixtures/​UpstreamMainCompatibilityTests.released-10.3.1-v1-append.hex Adds released V1 append fixture.
src/​Orleans.Journaling/​README.md Clarifies format selection and migration.
docs/​site/​src/​content/​docs/​grains/​journaling/​runtime-behavior.md Documents binary framing contracts.
docs/​site/​src/​content/​docs/​grains/​journaling/​configuration.md Adds migration guidance.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.


Providers expose the persisted format key as <xref:Orleans.Journaling.IJournalMetadata.FormatKey> and <xref:Orleans.Journaling.JournalMetadata.FormatKey>. Recovery selects the stored reader independently of the configured write format. When they differ, the next write creates a full snapshot using the configured format and updates the metadata. <xref:Orleans.Journaling.Json.JsonLinesJournalFormat.JournalFormatKey> supplies the JSON Lines format key.

When the stored format key is absent, recovery uses the configured format key. Configure `orleans-binary` to recover binary journals with missing format metadata. Before selecting a different write format, establish the stored key as `orleans-binary` using the provider's format-metadata mechanism and verify recovery. Back up the bytes and metadata together.
@ReubenBond ReubenBond closed this Oct 10, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Code coverage

Metric Pull request Current main Variance
Lines 83.39% (118,376 / 141,948) 83.38% (118,360 / 141,948) +0.0113 pp
Branches 72.93% (35,173 / 48,226) 72.93% (35,170 / 48,226) +0.0062 pp

Report-only conclusion: improved.

The current-main baseline is commit d726b68460 and uses the same reviewed coverage matrix.

Coverage combines every CI test matrix job, including providers, CodeGen, .NET 8/10, Linux, Windows, and macOS, using canonical physical source and branch identities.

The comparison remains report-only while normal line and branch variance is calibrated.

Coverage details

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