[SERVER-51799] Write and test the query for a tenant migration recipient to copy config.transactions entries for transactions that committed before a particular Timestamp Created: 21/Oct/20  Updated: 29/Oct/23  Resolved: 29/Oct/20

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 4.9.0

Type: Task Priority: Major - P3
Reporter: Esha Maharishi (Inactive) Assignee: Cheahuychou Mao
Resolution: Fixed Votes: 0
Labels: pm-1791_milestone-H
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-11-02
Participants:

 Description   

The recipient needs to use an aggregate or find to copy the donor's config.transactions entries with "state: committed" and lastWriteOpTime < startApplyingOpTime, and put these entries into the recipient's config.transactions with a null lastWriteOpTime.

This ticket is to write the exact aggregate pipeline that can be used to do this, and to write a test that uses it to fetch the entries from a donor and insert them into a recipient's config.transactions, then confirm that a commitTransaction retry against the recipient returns success.

The query shape would look something like:

// Get all config.transactions entries for committed transactions whose lastWriteOpTime
// is less than the migration's startApplyingOpTime.
{
    aggregate: "transactions",
    pipeline: [
        {$match: {"lastWriteOpTime.ts": {$lt: <startApplyingTimestamp>, "state": "committed"}}},
    ],
    readConcern: {level: "majority", afterClusterTime: <startApplyingTimestamp>},
    hint: "_id_",
    cursor: {},
}



 Comments   
Comment by Githook User [ 29/Oct/20 ]

Author:

{'name': 'Cheahuychou Mao', 'email': 'mao.cheahuychou@gmail.com', 'username': 'cheahuychou'}

Message: SERVER-51799 Write and test the query for a tenant migration recipient to copy config.transactions entries for transactions that committed before a particular Timestamp
Branch: master
https://github.com/mongodb/mongo/commit/44896232f5852d0fef3776cd77d346c0a8dd36c1

Comment by Esha Maharishi (Inactive) [ 21/Oct/20 ]

See this section of the design doc for background on how retryable writes and transactions retryability works, as well as how the retryability is maintained across a chunk migration and resharding.

Generated at Thu Feb 08 05:26:28 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.