[SERVER-72993] Support running bulkWrite commands in internal transactions Created: 18/Jan/23 Updated: 10/Nov/23 Resolved: 10/Nov/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | Lingzhi Deng | Assignee: | Backlog - Replication Team |
| Resolution: | Won't Fix | Votes: | 0 |
| Labels: | milestone-3 | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Assigned Teams: |
Replication
|
| Participants: |
| Description |
|
What we built in PM-2210 was to allow (internal) transactions to opt into storing history for each stmtId and then return the original response if some stmtId is retried. This should work out of the box for bulkWrite as bulkWrite also accepts a vector of stmtIds as its input. If a bulkWrite is executed inside an internal transaction on behalf of a client retryable write request, each op in the bulkWrite should have the same stmtId as its corresponding original write statement. Such bulkWrite may contain additional write statements that are not explicitly requested by a client retryable write command. In that case, we should assign stmtId kUninitializedStmtId (-1) for those auxiliary ops when executing bulkWrite in the internal transaction. Like insert/update/delete, the bulkWrite command will also include an unstable retriedStmtIds field in its response used internally to support retryability when running bulkWrite inside an internal transaction. This ticket should make sure the retriedStmtIds field is properly used and add tests for running bulkWrite in internal transactions (especially for retryability). |
| Comments |
| Comment by Lingzhi Deng [ 10/Nov/23 ] |
|
Retryable timeseries update for bulkWrite already uses the bulkWrite internal txn api so we get test coverage via that. |
| Comment by Sean Zimmerman [ 02/May/23 ] |
|
I agree that is probably the easiest way to test this |
| Comment by Lingzhi Deng [ 01/May/23 ] |
|
Additional, I wonder if we would want to "upgrade" some of the internal transaction API usages (e.g. the ones in fle_crud.cpp) to use the bulkWrite transaction API |
| Comment by Lingzhi Deng [ 01/May/23 ] |
|
I think |