[SERVER-83159] Add a method to recovery unit like onCommit but called for both commit and abort Created: 13/Nov/23  Updated: 14/Nov/23

Status: Backlog
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Mathias Stearn Assignee: Backlog - Storage Execution Team
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Storage Execution
Participants:

 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.


Generated at Thu Feb 08 06:51:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.