[SERVER-33617] fix collMod to update by UUID during oplog application Created: 02/Mar/18  Updated: 27/Oct/23  Resolved: 16/May/18

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

Type: Bug Priority: Major - P3
Reporter: Judah Schvimer Assignee: Xiangyu Yao (Inactive)
Resolution: Works as Designed Votes: 0
Labels: initialSync
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Related
related to SERVER-33644 getMissingDoc in initial sync needs t... Closed
Operating System: ALL
Backport Requested:
v3.6
Sprint: Storage NYC 2018-05-21
Participants:
Linked BF Score: 65

 Description   

These can happen due to initial sync idempotency requirements. Consider:
Node 1: create A with uuid 1
Node 2: start fetching oplog from Node 1
Node 1: collMod A with uuid 1
Node 1: rename A with uuid 1 to B
Node 1: create A with uuid 2
Node 2: clone collection A with uuid 2
Node 2: try to apply collMod on A with uuid 1



 Comments   
Comment by Xiangyu Yao (Inactive) [ 16/May/18 ]

Closing this since our code worked as designed: we translate the UUID to the namespace before we call collMod, so collMod is actually always using the UUID provided.

Comment by Ian Whalen (Inactive) [ 06/Apr/18 ]

See SERVER-34341 to avoid applying collMod for non-existent UUIDs.

Comment by Spencer Brody (Inactive) [ 27/Mar/18 ]

Putting back into Needs Triage since this is a regression in 3.6

Comment by Ian Whalen (Inactive) [ 09/Mar/18 ]

judah.schvimer:

From the Storage triage meeting, we believe this is a bug in collmod rather than an error that should be ignored. collMod should apply by UUID rather than by name in case of renamed collections during initial sync. Updating the title to reflect this.

Comment by Andy Schwerin [ 05/Mar/18 ]

If they turn out to be meaningful, better give them a name in the errorcodes file. You could still use the same number, of course.

Comment by Geert Bosch [ 02/Mar/18 ]

Yes, Node 2 does need to apply the collMod, but on collection B. That is, for oplog application the collection part of the namespace name should always be ignored and the operation should be performed based on the UUID. Looking at the code, we always do that for CRUD ops, and do it explicitly in the create and renameCollection commands. However, we seem to miss testing of other non-crud commands in combination with renames. I'd expect a test case for the scenario you describe inside jstests/replsets/apply_ops_idempotency.js would fail.

Comment by Judah Schvimer [ 02/Mar/18 ]

geert.bosch, do you see any problems with this?

Generated at Thu Feb 08 04:34:01 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.