[SERVER-55314] Transaction may not apply correctly if namespace does not exist in tenant migrations Created: 18/Mar/21  Updated: 29/Oct/23  Resolved: 22/Mar/21

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

Type: Bug Priority: Major - P3
Reporter: Xuerui Fa Assignee: Xuerui Fa
Resolution: Fixed Votes: 0
Labels: pm-1791_non-cloud-blocking, pm-1791_other_required
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Sprint: Repl 2021-04-05
Participants:

 Description   

While creating the tenant migrations transactions passthrough, I noticed that if a transaction contained a createCollection command and a few insert commands onto that collection, some of the inserts would fail to be applied on-disk. This seems to be because we allow the insert ops to be applied in different writer threads from the createCollection op. If the insert ops are applied first, they fail with a NamespaceNotFound error. However, the migration doesn't fail because we catch NamespaceNotFound errors and simply proceed with the applying the rest of the writer vector. The end result is that the insert ops simply aren't applied.

One straightforward approach to resolve this would be to ensure that all applyOps operations in a transaction are serialized into the same writer vector.



 Comments   
Comment by Githook User [ 22/Mar/21 ]

Author:

{'name': 'XueruiFa', 'email': 'xuerui.fa@mongodb.com', 'username': 'XueruiFa'}

Message: SERVER-55314: Serialize transaction if it contains a command op in tenant migrations
Branch: master
https://github.com/mongodb/mongo/commit/52c650492d6ed4d5e9e197ab7fb82f9de225e807

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