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

Primary running dropDatabase may fail to finish database drop after replicating it due to a step down

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 7.0.0-rc0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • Execution Team 2023-03-20
    • 135

      _finishDropDatabase() replicates the dropDatabase oplog entry before clearing the collection catalog. This is not done atomically.

      The problem is if we step down after writing out the dropDatabase oplog entry, the node becomes a secondary with the collection catalog still containing the database name. If the new primary creates the same database name with a different casing, the secondary will fatally assert with the following:

      [js_test:database_differ_case] d20040| {"t":{"$date":"2023-03-08T17:57:17.451+00:00"},"s":"F",  "c":"ASSERT",   "id":23095,   "ctx":"OplogApplier-0","msg":"Fatal assertion","attr":{"msgid":34437,"error":"DatabaseDifferCase: db already exists with different case already have: [test] trying to create [TEST]","file":"src/mongo/db/repl/oplog_applier_impl.cpp","line":394}}
      

            Assignee:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Reporter:
            gregory.wlodarek@mongodb.com Gregory Wlodarek
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: