[SERVER-62616] Enable reshard*.js tests in sharded_clustered_collections Created: 13/Jan/22  Updated: 29/Oct/23  Resolved: 02/Feb/22

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

Type: Task Priority: Major - P3
Reporter: Haley Connelly Assignee: Haley Connelly
Resolution: Fixed Votes: 0
Labels: PM-2311-M2
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-62975 PlanExecutorImpl may skip documents r... Closed
Backwards Compatibility: Fully Compatible
Sprint: Execution Team 2022-02-07
Participants:

 Comments   
Comment by Githook User [ 02/Feb/22 ]

Author:

{'name': 'Haley Connelly', 'email': 'haley.connelly@mongodb.com', 'username': 'haleyConnelly'}

Message: SERVER-62616 Enable reshard*.js tests in sharded_clustered_collections
Branch: master
https://github.com/mongodb/mongo/commit/2d86b7fbb3c41e728de80e6bcf32d3deceb824cf

Comment by Haley Connelly [ 25/Jan/22 ]

Marking as related to SERVER-62975 to preserve how we discovered the bug when running the sharding_clustered_collections suite on jstests/sharding/resharding_collection_cloner_resuming.js and got back a duplicate key error.

What happened:
resharding_data_copy_util's findDocWithHighestInsertedId ran find().sort({_id: -1}).limit(1) on the resharding temporary collection and got back null - suggesting no data had been copied to the collection yet. Then, the cloner incorrectly tried to copy data that already existed in the temporary resharding collection yielding a duplicate key.

Since non-blocking sort is not yet supported on clustered collections (SERVER-60824), SimpleSort was used for the query - which does not preserve the RecordId. Meaning the actual result was skipped by PlanExecutorImpl::_getNextImpl

Why only on a clustered collection:
On a non-clustered collection, the query yields an IXSCAN over _id and SimpleSort isn't encountered

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