Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-67924

4.2 secondary crashes on fassert when replicating a deprecated collMod command option originating from a 4.0 primary

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Won't Fix
    • 4.2.21
    • None
    • None
    • None
    • ALL
    • Hide

      This issue can be reproduced by running

      db.getSiblingDB("test").getCollection("test_col").insert({a:1})
      db.getSiblingDB("test").runCommand({ collMod: "test_col", usePowerOf2Sizes: true });
      

      on a 4.0 primary with one 4.2 secondary.

      Show
      This issue can be reproduced by running db.getSiblingDB("test").getCollection("test_col").insert({a:1}) db.getSiblingDB("test").runCommand({ collMod: "test_col", usePowerOf2Sizes: true }); on a 4.0 primary with one 4.2 secondary.

    Description

      During the upgrade path from 4.0 to 4.2, applications that use the 4.0 accepted command

      db.getSiblingDB("test").runCommand({ collMod: "test_col", usePowerOf2Sizes: true });
      

      will crash any 4.2 secondaries that attempt to replicate this command.

      2022-07-08T12:34:52.641-0400 E  REPL     [repl-writer-worker-0] Failed command { collMod: "test_col", usePowerOf2Sizes: true } on test with status InvalidOptions: unknown option to collMod: usePowerOf2Sizes during oplog application
      2022-07-08T12:34:52.660-0400 F  REPL     [repl-writer-worker-0] Error applying operation ({ op: "c", ns: "test.$cmd", ui: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), o: { collMod: "test_col", usePowerOf2Sizes: true }, o2: { collectionOptions_old: { uuid: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), flags: 1 } }, ts: Timestamp(1657298092, 1), t: 1, h: -8911072701486057981, v: 2, wall: new Date(1657298092618) }):  :: caused by :: InvalidOptions: unknown option to collMod: usePowerOf2Sizes
      2022-07-08T12:34:52.660-0400 F  REPL     [rsSync-0] Failed to apply batch of operations. Number of operations in batch: 1. First operation: { op: "c", ns: "test.$cmd", ui: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), o: { collMod: "test_col", usePowerOf2Sizes: true }, o2: { collectionOptions_old: { uuid: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), flags: 1 } }, ts: Timestamp(1657298092, 1), t: 1, h: -8911072701486057981, v: 2, wall: new Date(1657298092618) }. Last operation: { op: "c", ns: "test.$cmd", ui: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), o: { collMod: "test_col", usePowerOf2Sizes: true }, o2: { collectionOptions_old: { uuid: UUID("9cdb54d2-a0a7-4f68-9d94-ac0e6622b191"), flags: 1 } }, ts: Timestamp(1657298092, 1), t: 1, h: -8911072701486057981, v: 2, wall: new Date(1657298092618) }. Oplog application failed in writer thread 4: InvalidOptions: unknown option to collMod: usePowerOf2Sizes
      2022-07-08T12:34:52.660-0400 F  -        [rsSync-0] Fatal assertion 34437 InvalidOptions: unknown option to collMod: usePowerOf2Sizes at src/mongo/db/repl/sync_tail.cpp 851
      2022-07-08T12:34:52.660-0400 F  -        [rsSync-0] \n\n***aborting after fassert() failure\n\n
      

      This can lead to an undesirable upgrade experience that can cause 4.2 secondary nodes to suddenly crash while following the upgrade procedure.

      MongoDB should be able to handle this failed batch replication better either by ignoring it and/or logging that this collMod option is no longer supported.

      Attachments

        Activity

          People

            edwin.zhou@mongodb.com Edwin Zhou
            edwin.zhou@mongodb.com Edwin Zhou
            Votes:
            1 Vote for this issue
            Watchers:
            11 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: