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

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • Storage Execution

    Description

      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.

      Attachments

        Activity

          People

            backlog-server-execution Backlog - Storage Execution Team
            mathias@mongodb.com Mathias Stearn
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: