[SERVER-49748] Initial sync should clone admin.system.version before any other collections Created: 20/Jul/20  Updated: 29/Oct/23  Resolved: 18/Nov/21

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: 5.2.0, 5.1.2, 5.0.6

Type: Bug Priority: Major - P3
Reporter: Louis Williams Assignee: Jason Chan
Resolution: Fixed Votes: 0
Labels: former-quick-wins
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
Related
related to SERVER-31102 Clone admin.system.version first in i... Closed
related to SERVER-79269 Invariant that we don't check FCV in ... Open
is related to SERVER-48054 4.2 nodes that use auth and initial ... Closed
Backwards Compatibility: Fully Compatible
Operating System: ALL
Backport Requested:
v5.1, v5.0
Sprint: Replication 2021-11-29
Participants:
Linked BF Score: 119

 Description   

Collections cloned and indexes built before the admin.system.version collection will default to the lower FCV behavior because it will not have been initialized yet. See SERVER-48054 for a concrete example of how this introduces a bug.

This has the potential to further introduce problems. Collection and index formats have the potential to be based on the FCV. We want to be able to assume our data is in a particular format if the FCV is set to a specific version, and at the moment that is not possible.

To be safe and to avoid future bugs, we should clone this collection first.



 Comments   
Comment by Githook User [ 01/Dec/21 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-49748 Load sync source FCV into memory at beginning of initial sync

(cherry picked from commit ba6d92a5b0ff986c40a105d067786bc33f702764)
Branch: v5.0
https://github.com/mongodb/mongo/commit/8987ee4dae3961b22543959beec3f9e19ff3ab43

Comment by Githook User [ 01/Dec/21 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-49748 Load sync source FCV into memory at beginning of initial sync

(cherry picked from commit ba6d92a5b0ff986c40a105d067786bc33f702764)
Branch: v5.1
https://github.com/mongodb/mongo/commit/8d37f2a987b6734b139ad3b07dfeb5339233b785

Comment by Githook User [ 18/Nov/21 ]

Author:

{'name': 'Jason Chan', 'email': 'jason.chan@mongodb.com', 'username': 'jasonjhchan'}

Message: SERVER-49748 Load sync source FCV into memory at beginning of initial sync
Branch: master
https://github.com/mongodb/mongo/commit/ba6d92a5b0ff986c40a105d067786bc33f702764

Comment by Huayu Ouyang [ 15/Nov/21 ]

Marked as a bug because if a user creates a time-series collection on the admin database, and then a node goes through initial sync, the node might clone the time-series collection before the admin.system.version collection, and since creating a time-series collection checks the FCV, this results in an invariant failure (see BF-23342). This invariant can only occur on a node that is actively doing an initial sync.

Comment by Judah Schvimer [ 21/Aug/20 ]

We should consider if we want to retrieve the FCV and install it in memory before starting collection cloning at all, in case it affects any steps before cloning admin.system.version.

Comment by Louis Williams [ 24/Jul/20 ]

kevin.pulo, that's a good point. I talked to max.hirschhorn, and he is of the opinion that we don't want to do this. In the case of index/collection formats, we should rely on oplog entries and listCollections/listIndexes output.

It's unfortunate the FCV happens to clone almost-first, so we rarely find bugs in this area.

Comment by Kevin Pulo [ 24/Jul/20 ]

I hope admin.system.version never tries to rely on an FCV gated format! In all seriousness though, what I'm saying is that I think this ticket should also document this restriction somewhere/somehow appropriate (if it isn't already).

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