Orleans: [Feature Request] "Delete" a grain with transactional state

Created on 15 Mar 2019  路  1Comment  路  Source: dotnet/orleans

We have a couple cases where we would like to have a grain with transactional state that gets deleted after some amount of time. With a normal stateful grain you can call ClearStateAsync which with the right storage parameters will cause the grain state to get removed from storage. With transactional state there isn't currently such an option. It is possible to manually reset the state, but it still remains in storage. There isn't really a great way to know that it is safe to delete from storage manually either.

It does seem possible (though tricky) to implement the feature. Once all pending transactions are fully resolved it should be safe to delete. Could possibly delete in the "second phase" of the commit, but may not want to take that risk. Would also likely want to fail any new transactions that try to access state that is pending deletion.

enhancement

Most helpful comment

I agree that this could be a bit tricky, as resources could only be deleted once they'd confirmed or aborted all the transactions they're part of, and those acting as transaction managers would need to have notified all participants of commit or abort for all pending transactions. All of these are implementation details and not exposed via the application developer surface (ITransactionalState). Adding such a behavior without exposing these implementation details to the application layer will require some thought.
Putting this into back log to be considered for next feature pass on transactions.

>All comments

I agree that this could be a bit tricky, as resources could only be deleted once they'd confirmed or aborted all the transactions they're part of, and those acting as transaction managers would need to have notified all participants of commit or abort for all pending transactions. All of these are implementation details and not exposed via the application developer surface (ITransactionalState). Adding such a behavior without exposing these implementation details to the application layer will require some thought.
Putting this into back log to be considered for next feature pass on transactions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

scharada picture scharada  路  3Comments

Vlad-Stryapko picture Vlad-Stryapko  路  3Comments

danvanderboom picture danvanderboom  路  3Comments

gabikliot picture gabikliot  路  4Comments

pherbel picture pherbel  路  4Comments