ccstm icon indicating copy to clipboard operation
ccstm copied to clipboard

true nesting

Open nbronson opened this issue 14 years ago • 5 comments

To properly support retry/orElse we must implement partial rollback, at least when rolling back with retry. There are several components

  • child vs. top-level commit and rollback handlers
  • dynamic lookup of the parent txn (see #3)
  • capture of the partial read set during partial rollback for retry
  • capture or release of locks whose handle is removed from the write buffer during partial rollback

It would also be nice to generate partial rollback on conflict when possible.

nbronson avatar Mar 10 '10 19:03 nbronson

Note that true nesting is also required to properly implement rollback without retry on exception.

nbronson avatar Mar 11 '10 04:03 nbronson

How will this affect TxnLocal?

nbronson avatar Jun 24 '10 19:06 nbronson

It seems that maybe we don't need any additional handlers. beforeCommit and afterCommit should always refer to globally visible effects, hence they need only report top-level commit. afterRollback should report when writes performed by the particular nesting level have been undone, which may be a partial rollback.

ReadResources from a child txn may be discarded on partial rollback.

WriteResources from a child txn may be discarded on partial rollback after their performRollback method has been called.

nbronson avatar Jul 10 '10 07:07 nbronson

Hmm. Maybe we should include enough hooks that they could implement TxnLocal. Alternately, we could let them override the required hooks in a TxnLocal instance?

nbronson avatar Jul 10 '10 07:07 nbronson

Either partial rollback and partial retry both remove the current invariant that a txn that is no longer Active can never again be Active, or a pending partial rollback should not be encoded as the transaction status.

nbronson avatar Jul 10 '10 07:07 nbronson