server hits invariant on restarting with CBR enabled

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Query Optimization
    • ALL
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      {"t":

      {"$date":"2025-09-29T14:31:34.326+00:00"}

      ,"s":"F", "c":"ASSERT", "id":23079, "ctx":"initandlisten","msg":"Invariant failure","attr":{"expr":"statsCatalog","location":"src/mongo/db/query/compiler/stats/stats_catalog.cpp:79:5:static mongo::stats::StatsCatalog& mongo::stats::StatsCatalog::get(mongo::ServiceContext*)"}}

      is hit when server is being restarted by dsi as part of the cleaning procedure that happens in between tests as defined here: https://github.com/10gen/dsi/blob/79f189afe7bb5b72f9838485ed7c92ecdaa895a9/configurations/test_control/defaults.original.yml#L66

      Stats catalog is accessed here: https://github.com/10gen/mongo/blob/4b187f0408cca2f4acaa1fa2d4424b501089787a/src/mongo/db/query/compiler/stats/collection_statistics_impl.cpp#L63

      Stats catalog is supposed to be assigned here https://github.com/10gen/mongo/blob/eb44e53e46ca4beed28f8f29806771f3e68847df/src/mongo/db/mongod_main.cpp#L1157

      The fact that the invariant is hitting is probably because on restart we don't execute the function where the catalog is assigned.

      See a few examples here: https://spruce.mongodb.com/version/68da908fda71d90007d9e957/tasks?sorts=STATUS%3AASC%3BBASE_STATUS%3ADESC

            Assignee:
            Hana Pearlman
            Reporter:
            Carlos Alonso Pérez
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated: