-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
Affects Version/s: 5.0 Required
-
Component/s: None
-
Fully Compatible
-
ALL
-
Repl 2021-04-05
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.