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

MongoDB Automatic Restart Due to Index Incompatibility After Upgrading

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 4.4.29
    • Component/s: None
    • None
    • ALL

      After continuously upgrading MongoDB from v3.4.24 to v4.4.29, the system encountered issues during runtime where MongoDB would automatically restart. The error logs are as follows:

      Unknown macro: {"t"}

      ,"s":"F",  "c":"-",        "id":23079,   "ctx":"conn317028","msg":"Invariant failure","attr":{"expr":"elt.type() != BSONType::Array","file":"src/mongo/db/index/btree_key_generator.cpp","line":75}}

      Unknown macro: {"t"}

      ,"s":"F",  "c":"-",        "id":23080,   "ctx":"conn317028","msg":"\n\n***aborting after invariant() failure\n\n"}

      Unknown macro: {"t"}

      ,"s":"F",  "c":"CONTROL",  "id":4757800, "ctx":"conn317028","msg":"Writing fatal message","attr":{"message":"Got signal: 6 (Aborted).\n"}}

      From the error logs, it seems likely that the issue is related to an incompatibility with indexes created in older versions. However, the complete `mongodb.log` file did not indicate which specific collection's index was causing the issue.

      To resolve this, I had to drop all indexes in the database and recreate them, after which the problem stopped occurring.

      I would like to know whether this is a historical bug in MongoDB or if it was caused by some other issue?

      For more error log information, see the attachment. mongodb_error.log

       

            Assignee:
            chris.kelly@mongodb.com Chris Kelly
            Reporter:
            wuyanfeiwork@gmail.com Yanfei Wu
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: