[SERVER-57452] Investigate if the sort stage in the retryable write pre-fetch pipeline is necessary Created: 04/Jun/21  Updated: 29/Oct/23  Resolved: 09/Jun/21

Status: Closed
Project: Core Server
Component/s: Replication
Affects Version/s: None
Fix Version/s: 5.0.0-rc2, 5.1.0-rc0

Type: Improvement Priority: Major - P3
Reporter: Wenbin Zhu Assignee: Wenbin Zhu
Resolution: Fixed Votes: 0
Labels: pm-1791_non-cloud-blocking
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Backwards Compatibility: Fully Compatible
Backport Requested:
v5.0
Sprint: Repl 2021-06-14
Participants:

 Description   

In tenant migration, we use an aggregation pipeline to pre-fetch retryable writes from the donor. The pipeline includes a  sort stage, which might not be necessary because when inserting the pre-fetch result into the oplog buffer, it will be sorted. This ticket needs to verify if this stage can be removed.



 Comments   
Comment by Vivian Ge (Inactive) [ 06/Oct/21 ]

Updating the fixversion since branching activities occurred yesterday. This ticket will be in rc0 when it’s been triggered. For more active release information, please keep an eye on #server-release. Thank you!

Comment by Githook User [ 09/Jun/21 ]

Author:

{'name': 'Wenbin Zhu', 'email': 'wenbin.zhu@mongodb.com', 'username': 'WenbinZhu'}

Message: SERVER-57452 Remove the sort stage in retryable write pre-fetch as oplog buffer now allows unordered insert.

(cherry picked from commit 577a79b14113874d64294a81ba97ca65522f019b)
Branch: v5.0
https://github.com/mongodb/mongo/commit/a946a263a0c4f43b41651fa91c214d75455f307c

Comment by Githook User [ 09/Jun/21 ]

Author:

{'name': 'Wenbin Zhu', 'email': 'wenbin.zhu@mongodb.com', 'username': 'WenbinZhu'}

Message: SERVER-57452 Remove the sort stage in retryable write pre-fetch as oplog buffer now allows unordered insert.
Branch: master
https://github.com/mongodb/mongo/commit/577a79b14113874d64294a81ba97ca65522f019b

Comment by Wenbin Zhu [ 08/Jun/21 ]

The preload() method introduced in SERVER-53509 allows unordered entries to be inserted into oplog buffer collection. And since reading oplog buffer collection returns entries in timestamp order, the sort stage during pre-fetch can be removed.

Comment by Lingzhi Deng [ 07/Jun/21 ]

We had the sort stage before we added the preload method to the oplog buffer in SERVER-53509. Now that the pre-fetched entries are inserted to the oplog buffer using preload, we can probably remove the sort stage.

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