orleans
orleans copied to clipboard
DeleteStateOnClear support for AdoNet storage provider
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 =>
- If non existent (no rows in db table) state is cleared; inconsistent state exception is thrown
- 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
- 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 =>
- If non existent (no rows in db table) state is cleared; inconsistent state exception is thrown
- If a non-cleared state is cleared; db row is deleted, State.ETag is set to null and State.RecordExists is set to false
- If a cleared state is cleared again; inconsistent state exception is thrown
- 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