Skip to content

Conversation

@m3nax
Copy link
Contributor

@m3nax m3nax commented Dec 17, 2025

Added ClearLogAsync to the JournaledGrain in order to completely erase the stored data of the grain
Implemented the method in StateStorage and LogStorage
Added the method to be implemented in the ICustomStorageInterface interface with a default implementation in order to avoid breaking changes

REF: #8408

Microsoft Reviewers: Open in CodeFlow

@m3nax m3nax changed the title Added ClearLogAsync method to JournaledGrain Add ClearLogAsync method to JournaledGrain Dec 17, 2025
@m3nax m3nax marked this pull request as ready for review January 7, 2026 20:56
Copilot AI review requested due to automatic review settings January 7, 2026 20:56
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds a ClearLogAsync method to JournaledGrain to enable complete erasure of stored grain data. This addresses a feature request (#8408) for a way to reset event-sourced grains to their initial state.

Key Changes:

  • Added ClearLogAsync method to the JournaledGrain base class and ILogViewUpdate interface
  • Implemented ClearLogAsync in StateStorage, LogStorage, and CustomStorage adaptors
  • Added backward-compatible default implementation to ICustomStorageInterface using C# default interface methods

Reviewed changes

Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/Orleans.EventSourcing/JournaledGrain.cs Exposes protected ClearLogAsync method for grain subclasses
src/Orleans.EventSourcing/LogConsistency/ILogViewAdaptor.cs Adds ClearLogAsync to the ILogViewUpdate interface
src/Orleans.EventSourcing/StateStorage/LogViewAdaptor.cs Implements clear logic for state storage backend
src/Orleans.EventSourcing/LogStorage/LogViewAdaptor.cs Implements clear logic for log storage backend
src/Orleans.EventSourcing/CustomStorage/LogViewAdaptor.cs Implements clear logic for custom storage backend
src/Orleans.EventSourcing/CustomStorage/ICustomStorageInterface.cs Adds default ClearStoredState method with NotSupportedException
src/Orleans.EventSourcing/Common/PrimaryBasedLogViewAdaptor.cs Adds base implementation, ResetTentativeState helper, and caches initial state

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.

1 participant