|
As an attempt to describe the issue in a slightly different way: The following sequence of oplog entries are a valid history of operations performed by the primary because it is possible (1) for the write to the oplog that sets targetVersion=3.6 to commit before the write to the oplog that creates a collection, and for (2) creating the collection to observe serverGlobalParams.featureCompatibility in either targetVersion unset or targetVersion=3.6.
{ "ts" : Timestamp(1509509049, 154), "t" : NumberLong(1), "h" : NumberLong("-121227912217949421"), "v" : 2, "op" : "u", "ns" : "admin.system.version", "o2" : { "_id" : "featureCompatibilityVersion" }, "o" : { "_id" : "featureCompatibilityVersion", "version" : "3.4", "targetVersion" : "3.6" } }
|
{ "ts" : Timestamp(1509509049, 155), "t" : NumberLong(1), "h" : NumberLong("2059760424251381818"), "v" : 2, "op" : "c", "ns" : "test.$cmd", "o" : { "create" : "readMajority", "idIndex" : { "v" : 2, "key" : { "_id" : 1 }, "name" : "_id_", "ns" : "test.readMajority" } } }
|
{ "ts" : Timestamp(1509509049, 168), "t" : NumberLong(1), "h" : NumberLong("4964440004185536663"), "v" : 2, "op" : "c", "ns" : "test.$cmd", "ui" : UUID("4100b5da-8303-4109-b8de-ee48fd5f8202"), "o2" : { "collectionOptions_old" : { } }, "o" : { "collMod" : "readMajority" } }
|
The problem comes from how the secondary treats serverGlobalParams.featureCompatibility.getVersion() == kUpgradingTo36 as a case where it should generate its own UUID (like the primary would have in this circumstance). I suspect the appropriate change is to remove the serverGlobalParams.featureCompatibility.getVersion() != ServerGlobalParams::FeatureCompatibility::Version::kFullyUpgradedTo36 condition since serverGlobalParams.featureCompatibility.isSchemaVersion36() already covers both cases where UUIDs are permitted and/or expected.
|