Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-83159

Add a method to recovery unit like onCommit but called for both commit and abort

    • Type: Icon: Improvement Improvement
    • Resolution: Unresolved
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Storage Execution
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None

      Suggested API: void onWuowEnd(std::invocable<void(OpCtx*, bool commited)> auto cb) (onCommitOrAbort() would also be an acceptable, if wordy, name)

      This would allow code that needs to take an action at either commit or abort time to do so without registering two callback (which duplicates the state captured by lambdas, doubles the allocations of underlying Changes, and requires two virtual calls at commit/abort time) as is done here, or using the more cumbersome registerChange() api which is both less discoverable (doesn't follow the pattern of onCommit()/onAbort()) and requires the syntactic overhead of defining a type and creating an instance of it rather than using a lambda. Also there is often common code between commit and abort, so passing a bool to a combined function makes it easier to not repeat that common code.

            Assignee:
            backlog-server-execution [DO NOT USE] Backlog - Storage Execution Team
            Reporter:
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: