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

getLastError(2) hangs/timesout about every N inserts into replica set shard

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 1.7.5
    • Affects Version/s: 1.7.0
    • Component/s: Sharding
    • Labels:
      None
    • Environment:
      db version v1.7.1-pre-, pdfile version 4.5
      Tue Sep 14 13:19:38 git version: 524e633748a24b5a1e753373ba63e5c267964576
    • ALL

      1. Create replica set of 3 servers.
      2. Add data to it.
      3. Create 3 config servers for sharding.
      4. Create one router (mongos)
      5. Add replica set as solo shard
      6. enable sharding on the db and collection that you already added data to
      7. Repeatedly insert a record into sharded collection and check insert has gone to 2 replicas (getLastError(2))

      There is a jstest for this test case at: jstests/grid/shard_insert_getlasterror_w2.

      Problem: About every 170th insert fails (getLastError times out) on my Macbook
      result of timed-out getLastErrorObj(2,30000) looks like:
      {
      "shards" : [
      "127.0.0.1:31003,127.0.0.1:31004,127.0.0.1:31005",
      "repset1/127.0.0.1:31000,127.0.0.1:31001,127.0.0.1:31002"
      ],
      "n" : 0,
      "err" : "",
      "errs" : [
      ""
      ],
      "errObjects" : [

      { "err" : null, "n" : 0, "wtimeout" : true, "waited" : 30000, "errmsg" : "timed out waiting for slaves", "ok" : 0 }

      ],
      "ok" : 1
      }

      Result of a successful getLastErrorObj(2,30000) looks like:
      {
      "theshard" : "repset1/127.0.0.1:31000,127.0.0.1:31001,127.0.0.1:31002",
      "err" : null,
      "n" : 0,
      "lastOp" : NumberLong("5516791406158413840"),
      "wtime" : 2,
      "ok" : 1,
      "singleShard" : "repset1/127.0.0.1:31000,127.0.0.1:31001,127.0.0.1:31002"
      }

            Assignee:
            kristina Kristina Chodorow (Inactive)
            Reporter:
            tonyh Tony Hannan
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: