It may not cause any incorrect behavior (that I know of), but it's weird... we should make the write to mark the collection entry as 'dropped' use $set rather than a replacement-style update.
Example collection entry after shardCollection (produced using the attached repro):
collEntryBefore: {
"_id" : "test.foo",
"lastmodEpoch" : ObjectId("5a023322d22a4537cf47b2a1"),
"lastmod" : ISODate("1970-02-19T17:02:47.296Z"),
"dropped" : false,
"key" : {
"x" : 1
},
"unique" : false,
"uuid" : UUID("052e805a-f4e5-4e0e-93a2-0865fbd59e1c")
}
How that collection entry looks after drop:
collEntryAfter: {
"_id" : "test.foo",
"lastmodEpoch" : ObjectId("000000000000000000000000"),
"lastmod" : ISODate("2017-11-07T22:26:43.080Z"),
"dropped" : true
}
It also looks like dropCollection clears the lastmodEpoch (i.e., epoch); I don't see why it should do this?