setFCV logs slow queries in system.profile for DBs with profiling disabled

    • Type: Bug
    • Resolution: Unresolved
    • Priority: Major - P3
    • None
    • Affects Version/s: 8.3.0-rc0, 8.2.0, 9.0.0-rc0
    • Component/s: None
    • None
    • Catalog and Routing
    • ALL
    • 200
    • 馃煩 Routing and Topology
    • None
    • None
    • None
    • None
    • None
    • None

      During FCV upgrade setFCV can end up logging operations in <db>.system.profile even if <db> does not have profiling enabled. This happens because the CurOp of the setFCV OperationContext becomes dirty from the collMods that setFCV runs聽(for example, over all collections to clean up invalid index options) such that the profiling level and the NSS is a mixup of the state of multiple DBs.

      This is a re-ocurrence (regression) of SERVER-85925.

      This can happens as follows:

      • The user enables profiling on DB "test" only.
      • The user creates collection "test.somecollection".
      • The user calls setFCV to upgrade the FCV.
      • setFCV it runs collMod on "test.somecollection":
      • setFCV runs collMod on "config.whatever":
      • When the command ends, in the Service Entry Point:
        • It will see that the CurOp NSS is "config.whatever"
        • The CurOp dbprofilelevel is enabled.
        • Therefore, if setFCV took more than 100ms it will log on "config.system.profile" despite profiling not being on "config".

      A reproducer is attached.

      We should prevent the CurOp of setFCV from getting dirty from any sub-operations it calls.

            Assignee:
            Unassigned
            Reporter:
            Joan Bruguera Mic贸
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: