Collection not in config.collections after shardCollection success

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Gone away
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Tools and Replicator
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In the linked mongosync BF, we're seeing a situation where the config.collections collection does not include an entry for staging.kiwi even though a shardCollection command was run on it. 

      In the destination oplog for shard1, we see the following entries, indicating that the shardCollection command succeeded:

      Enterprise shard-rs1 [direct: primary] local> db.oplog.rs.find({ ns: 'staging.kiwi' })
      [
        {
          op: 'n',
          ns: 'staging.kiwi',
          ui: new UUID("70580c19-aefc-41b4-8838-d91e675fb790"),
          o: { msg: { shardCollectionPrepare: 'staging.kiwi' } },
          o2: {
            shards: [ 'shard-rs1' ],
            shardCollectionPrepare: 'staging.kiwi',
            shardKey: { _id: 1 },
            unique: false,
            numInitialChunks: Long("0"),
            presplitHashedZones: false,
            collation: { locale: 'simple' },
            collectionUUID: new UUID("70580c19-aefc-41b4-8838-d91e675fb790"),
            implicitlyCreateIndex: false,
            enforceUniquenessCheck: false
          },
          ts: Timestamp({ t: 1711038109, i: 137 }),
          t: Long("1"),
          v: Long("2"),
          wall: ISODate("2024-03-21T16:21:49.398Z")
        },
        {
          op: 'n',
          ns: 'staging.kiwi',
          ui: new UUID("70580c19-aefc-41b4-8838-d91e675fb790"),
          o: { msg: { shardCollection: 'staging.kiwi' } },
          o2: {
            shardCollection: 'staging.kiwi',
            shardKey: { _id: 1 },
            unique: false,
            numInitialChunks: Long("0"),
            presplitHashedZones: false,
            collation: { locale: 'simple' },
            collectionUUID: new UUID("70580c19-aefc-41b4-8838-d91e675fb790"),
            implicitlyCreateIndex: false,
            enforceUniquenessCheck: false
          },
          ts: Timestamp({ t: 1711038109, i: 141 }),
          t: Long("1"),
          v: Long("2"),
          wall: ISODate("2024-03-21T16:21:49.402Z")
        }
      ] 

      However, when we check config.collections via the mongos, there is no entry for staging.kiwi

      Enterprise [direct: mongos] config> db.collections.find().pretty()
      [
        {
          _id: 'config.system.sessions',
          lastmodEpoch: ObjectId("65fc5e95d9d7319a797cb7fe"),
          lastmod: ISODate("2024-03-21T16:21:41.254Z"),
          timestamp: Timestamp({ t: 1711038101, i: 31 }),
          uuid: new UUID("ae2db127-0ca7-4889-be9f-9d42bcecf2b6"),
          key: { _id: 1 },
          unique: false,
          noBalance: false,
          maxChunkSizeBytes: Long("200000")
        },
        {
          _id: 'mongosync_reserved_for_internal_use.lastWriteStates.test',
          lastmodEpoch: ObjectId("65fc5e9caee02753853d9b48"),
          lastmod: ISODate("2024-03-21T16:21:49.021Z"),
          timestamp: Timestamp({ t: 1711038108, i: 79 }),
          uuid: new UUID("61053824-b507-407c-bc05-555c27c0a876"),
          key: { _id: 'hashed' },
          unique: false,
          noBalance: false
        },
        {
          _id: 'mongosync_reserved_for_internal_use.lastWriteStates.staging',
          lastmodEpoch: ObjectId("65fc5e9daee02753853d9b87"),
          lastmod: ISODate("2024-03-21T16:21:49.292Z"),
          timestamp: Timestamp({ t: 1711038109, i: 86 }),
          uuid: new UUID("68e3165b-c08b-4d37-81f5-eec62896e94c"),
          key: { _id: 'hashed' },
          unique: false,
          noBalance: false
        },
        {
          _id: 'test.apricot',
          lastmodEpoch: ObjectId("65fc5e9dd9d7319a797cb882"),
          lastmod: ISODate("2024-03-21T16:21:49.174Z"),
          timestamp: Timestamp({ t: 1711038109, i: 50 }),
          uuid: new UUID("c62c8f44-79a4-4709-9261-7668c4d1fdb1"),
          key: { _id: 1 },
          unique: false,
          noBalance: false
        }
      ] 

      This is on server version mongodb_mongo_v7.0_3e693c1ec64b3466a610e492f5415d9439b7348d

            Assignee:
            Johnny DuBois (Inactive)
            Reporter:
            Johnny DuBois (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: