...
In BF-9590, we could enter dropCollection() with kMajorityCommitted ReadSource since it's set previously by another command which used the same RecoveryUnit. Then, we read the on-disk index catalog with majorityCommitted timestamp and compare it with the in-memory one. If an index creation was just done after the majority committed point, the in-memory and the on-disk index catalog did not match. I think we should assert that DropCollection() is performed with kUnset/kNoTimestamp ReadSource, or at least be aware that DropCollection() can be performed with other ReadSources. It would be useful to prevent bugs that arise from misusing the storage layer that are difficult and racy to diagnose. Potential fixes: 1. Use AutoGetCollectionForRead in dropCollection() to get the collection. AutoGetCollectionForRead has the check for conflicting catalog changes. If the ReadSource is set to a majority timestamp which is less than MinVisibleSnapshotTimestamp, AutoGetCollectionForRead throws an exception and dropCollection() can retry. 2. Put an invariant "opCtx->RecoveryUnit()->getTimestampReadSource() == kUnset" in dropCollection.
xiangyu.yao commented on Thu, 24 Jan 2019 00:15:29 +0000: The invariant failed (BF-11843) due to the use of ConfigSvrDropCollectionCommand, indicating that SERVER-35804 is indeed still a problem. Since SERVER-35804 is in the sharding backlog, I am going to close this ticket as Won't Fix. milkie commented on Wed, 16 Jan 2019 15:50:07 +0000: Reverted to due to build failures. xgen-internal-githook commented on Wed, 16 Jan 2019 15:48:23 +0000: Author: {'username': 'milkie', 'email': 'milkie@10gen.com', 'name': 'Eric Milkie'} Message: Revert "SERVER-35828 Check the readSource in dropCollection()" This reverts commit 29efd5d05db9caab8c8812a83b6692e2e29b5f39. Branch: master https://github.com/mongodb/mongo/commit/e4e4d53329c475c0309b5bcf635214342d08d933 xgen-internal-githook commented on Mon, 14 Jan 2019 22:01:21 +0000: Author: {'username': 'xy24', 'email': 'xiangyu.yao@mongodb.com', 'name': 'Xiangyu Yao'} Message: SERVER-35828 Check the readSource in dropCollection() Branch: master https://github.com/mongodb/mongo/commit/29efd5d05db9caab8c8812a83b6692e2e29b5f39