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

Find on admin.$cmd.sys.inprog asserts on top-level $query field

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: 3.0.12
    • Component/s: Diagnostics
    • Labels:
    • ALL

      Emulating the db.currentOp() shell method on older MongoDB versions (without the currentOp command) requires a query to the admin database's $cmd.sys.inprog collection. I encountered the following assertion failure when attempting to query the current op from the PHPC driver:

      AssertionException handling request, closing client connection: 16810 bad query: BadValue unknown top level operator: $query

      From the driver's perspective, the socket is closed and we time out while attempting to read a response.

      The assertion is no doubt due to logic in the PHPC driver that always includes the filter under a top-level $query field, even if the query contains no other modifiers necessitating so (e.g. $orderby, modifiers). While this is certainly something we can fix in PHPC, I wonder if the the server should still relax its assertion here.

      I've linked this to SERVER-17951, where the server was rejecting similar queries due to a top-level $readPreference field. If this is deemed worthy of a fix, you may want to also investigate the killOp and fsyncUnlock operations, which were also addressed in SERVER-17951.

            Unassigned Unassigned
            jmikola@mongodb.com Jeremy Mikola
            0 Vote for this issue
            6 Start watching this issue