Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DeleteStateOnClear support for AdoNet storage provider #8535

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

modabas
Copy link

@modabas modabas commented Jul 8, 2023

This PR is for issue #8059

Scripts are updated for Mssql and Potgresql only. Mysql and Oracle scripts need to be updated with a new step in OrleansQuery table with QueryKey = 'DeleteStorageKey'. Even so, current implementation should run as is, if DeleteStateOnClear option is not explicitly set to true.

There are some behaviour differences between DeleteStateOnClear option is set to false (same as current functionality and default option for this PR) and true. These are observed with both Postgresql and Mssql providers

Update on clear state =>

  1. If non existent (no rows in db table) state is cleared; inconsistent state exception is thrown
  2. If a non-cleared state is cleared; db version is incremented, State.ETag is set to new db version, db payload is set to null and State.RecordExists is set to false
  3. If a cleared state is cleared again; db version is incremented, State.ETag is set to new db version, db payload is set to null and State.RecordExists is set to false
    If grain whose state is cleared is reinitiated (or application restart), State.RecordExists is seen as true from grain

Delete on ClearState =>

  1. If non existent (no rows in db table) state is cleared; inconsistent state exception is thrown
  2. If a non-cleared state is cleared; db row is deleted, State.ETag is set to null and State.RecordExists is set to false
  3. If a cleared state is cleared again; inconsistent state exception is thrown
  4. If a state previously cleared with update is cleared; db row is deleted, State.ETag is set to null and State.RecordExists is set to false
    If grain whose state is cleared is reinitiated (or application restart), State.RecordExists is seen as false from grain
Microsoft Reviewers: Open in CodeFlow

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