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

While a node is not in primary/secondary state, dbStats/collStats should not hang

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Diagnostics
    • Labels:
      None
    • Backport Requested:
      v4.2, v4.0, v3.6
    • Sprint:
      Execution Team 2019-12-16, Execution Team 2020-02-10, Execution Team 2019-12-30, Execution Team 2020-05-18
    • Case:
    • Linked BF Score:
      47

      Description

      Currently when a node is in initial sync (STARTUP2), running a query on a collection (except collections in local database) returns error "NotMasterOrSecondary":

      > db.docs.find()
      Error: error: {
          "operationTime" : Timestamp(0, 0),
          "ok" : 0,
          "errmsg" : "node is not in primary or recovering state",
          "code" : 13436,
          "codeName" : "NotMasterOrSecondary",
          "$clusterTime" : {
              "clusterTime" : Timestamp(1550198882, 1),
              "signature" : {
                  "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
                  "keyId" : NumberLong(0)
              }
          }
      }
      

      However, when we run the dbStats or collStats commands (on the collection that is syncing), the commands will just hang there, waiting for locks. Since the node is in STARTUP2 state (not ready for reads), will we consider just returning an error "NotMasterOrSecondary" for dbStats/collStats/listDatabases/etc commands (same as the {find}} command)?

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              gregory.wlodarek Gregory Wlodarek
              Reporter:
              linda.qin Linda Qin
              Participants:
              Votes:
              2 Vote for this issue
              Watchers:
              18 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: