BugZero found this defect 81 days ago.
Data sources
All data on this page is proprietary to BugZero® or gathered from public sources
3/13/2024
MongoDB Server
No affected releases provided.
No fixed releases provided.
PM-1632 added the possibility to run an update without a shard key in sharded clusters with all options. As part of the project SERVER-76530 added an optimization for findAndModify, trying to not go through the protocol if all the chunks are owned by a single shard. the collection has a single chunk. However, the following scenario might happen: A transaction with snapshot read concern starts and performs a write to a collection at time T1. This effectively sets the atClusterTime of the entire transaction to T1. A moveChunk happens, changing the placement for collection2 at time T2. A findAndModify for collection2 is issued, the said optimization for PM-1632 will try to target the destination shard of the migration, with the correct shard version, but with the wrong clusterTime (T1), This will cause the findAndModify to not find the document. You can find the repro attached. Until we can safely use the optimization, we could simply target using the default path.
Run the attached repro