GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — fix(journaling): make snapshot commits and rollback atomic by ReubenBond · Pull Request #10681 · dotnet/orleans Conversation
|
| File | Description |
|---|---|
| test/Orleans.Journaling.Tests/StateManagerTests.cs | Updates snapshot expectations (no append during snapshot replace) and adds coverage for snapshot-failure retry atomicity, revert behavior, and write fencing. |
| test/Orleans.Journaling.Tests/OrleansBinaryCommandCodecTests.cs | Adds golden-payload and aliasing tests to validate independent reference scopes during snapshot replay. |
| test/Orleans.Journaling.Tests/JournaledGrainParticipantTests.cs | Adds integration tests validating participant initialization ordering/once-per-activation and failure propagation. |
| test/Orleans.Journaling.Tests/DurableListDirectWriteTests.cs | Updates a test stub to satisfy the expanded IJournaledStateManager contract. |
| test/Orleans.Journaling.Tests/DurableCollectionDirectWriteTests.cs | Updates a test stub to satisfy the expanded IJournaledStateManager contract. |
| test/Benchmarks/Journaling/DurableListJournalBenchmarks.cs | Updates a benchmark stub to satisfy the expanded IJournaledStateManager contract. |
| src/Orleans.Journaling/JournaledStateManager.cs | Implements write fencing, adds RevertPendingChangesAsync, and adjusts snapshot write semantics to treat replace as a single logical commit. |
| src/Orleans.Journaling/IJournaledStateManager.cs | Adds RevertPendingChangesAsync to the public state-manager contract. |
| src/Orleans.Journaling/IJournaledGrainParticipant.cs | Adds the participant initialization contract to enable composable journaling features. |
| src/Orleans.Journaling/Formats/OrleansBinary/OrleansBinaryDurableSetCommandCodec.cs | Uses independent-value reads for snapshot items to reset reference scopes per element. |
| src/Orleans.Journaling/Formats/OrleansBinary/OrleansBinaryDurableQueueCommandCodec.cs | Uses independent-value reads for snapshot items to reset reference scopes per element. |
| src/Orleans.Journaling/Formats/OrleansBinary/OrleansBinaryDurableListCommandCodec.cs | Uses independent-value reads for snapshot items to reset reference scopes per element. |
| src/Orleans.Journaling/Formats/OrleansBinary/OrleansBinaryDurableDictionaryCommandCodec.cs | Uses independent-value reads for snapshot keys/values to reset reference scopes per key/value. |
| src/Orleans.Journaling/Formats/OrleansBinary/OrleansBinaryCommandCodecHelpers.cs | Adds ReadIndependentValue which resets the serializer session after each independently encoded snapshot value. |
| src/Orleans.Journaling/DurableGrain.cs | Initializes all registered IJournaledGrainParticipant instances before lifecycle recovery. |
| src/api/Orleans.Journaling/Orleans.Journaling.cs | Updates generated public API surface for the new participant and state-manager members. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.Journaling/JournaledStateManager.cs:859
string operation;
lock (_lock)
{
ThrowIfWritesFenced();
var isSnapshot = _migrationSnapshotRequired || _storage.IsCompactionRequested;
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Previously missed (1) — in code that hasn't changed since the last review.
src/Orleans.Journaling/JournaledStateManager.cs:927
private void ThrowIfWritesFenced()
{
if (_state is ManagerState.Recovering or ManagerState.Fenced)
{
throw new InvalidOperationException(
"Journaled state writes are fenced until recovery completes successfully. Call RevertPendingChangesAsync to retry recovery.");
}
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
src/Orleans.Journaling/JournaledStateManager.cs:916
Consider treating ManagerState.Unknown as uninitialized for all write operations.
private void ThrowIfWriteOperationsUnavailable()
{
_shutdownCancellation.Token.ThrowIfCancellationRequested();
if (_workLoop is null)
{
throw new InvalidOperationException("The journaled state manager has not been initialized.");
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Previously missed (1) — in code that hasn't changed since the last review.
test/Orleans.Journaling.Tests/StateManagerTests.cs:2174
throw exception; resets the stack trace, which makes diagnosing failures harder. Use ExceptionDispatchInfo to rethrow while preserving the original stack trace (still throwing the same exception instance). if (NextReplaceException is { } exception)
{
NextReplaceException = null;
throw exception;
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Previously missed (1) — in code that hasn't changed since the last review.
src/Orleans.Journaling/JournaledStateManager.cs:972
cancellationToken.ThrowIfCancellationRequested();
_shutdownCancellation.Token.ThrowIfCancellationRequested();
Task pendingRecovery;
bool didEnqueue;
lock (_lock)
{
if (_state is ManagerState.Unknown)
{
throw new InvalidOperationException("The journaled state manager has not been initialized.");
}
pendingRecovery = EnqueueOrGetPendingWorkItem<RevertPendingChangesWorkItem>(out didEnqueue);
_state = ManagerState.Recovering;
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Previously missed (1) — in code that hasn't changed since the last review.
src/Orleans.Journaling/DurableGrain.cs:18
foreach (var feature in ServiceProvider.GetServices<IJournaledGrainParticipant>())
{
feature.Initialize();
}
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.