After writing the record to collection table, we index records. While indexing records, we track any index keys that needs to be marked as multikey in the _mdb_catlog table for that collection, via opCtx decoration. And, we don't reset the tracker after marking the index as multi-key in the collection catalog entry. So, if write ops on different collection shares the same opCtx, we might wrongly mark an index as multi-key for a collection if the index keys of that collection has the same name as the multikey index name of the previously applied collection operation.
In tenant oplog applier case, write ops on different collection that's get applied by the same TenantMigrationWriter thread in a single batch, will share the same opCtx. This can lead either to tenant migration failure due to this error or silently marking a wrong index as mutikey on recipient primary.
- is related to
-
SERVER-60754 Setting multikey in _mdb_catalog can be out of timestamp order
- Closed