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

WriteConcern with tags>2 say the write timedout, when it didn't

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: 2.2.1, 2.4.1
    • Fix Version/s: 2.4.4, 2.5.0
    • Component/s: Replication
    • Labels:
      None
    • Operating System:
      ALL

      Description

      $ mongo localhost:31200
      MongoDB shell version: 2.5.0-pre-
      connecting to: localhost:31200/test
      Server has startup warnings:
      Wed Apr 10 18:43:07.479 [initandlisten]
      Wed Apr 10 18:43:07.479 [initandlisten] ** NOTE: This is a development version (2.5.0-pre-) of MongoDB.
      Wed Apr 10 18:43:07.479 [initandlisten] **       Not recommended for production.
      Wed Apr 10 18:43:07.479 [initandlisten]
      anden(mongod-2.5.0-pre-)[PRIMARY/SHARDING-rs1] test> rs.config()
      {
        "_id": "SHARDING-rs1",
        "version": 4,
        "members": [
          {
            "_id": 0,
            "host": "anden.local:31200",
            "tags": {
              "dc": "ny",
              "server": "0"
            }
          },
          {
            "_id": 1,
            "host": "anden.local:31201",
            "tags": {
              "dc": "hobo",
              "server": "1",
              "theOtherShard": "doesntHaveThisTag"
            }
          },
          {
            "_id": 2,
            "host": "anden.local:31202",
            "priority": 0,
            "tags": {
              "dc": "sf",
              "server": "2"
            }
          }
        ],
        "settings": {
          "getLastErrorModes": {
            "ALL": {
              "server": 3
            },
            "AllDC": {
              "dc": 2
            },
            "AnyDC": {
              "dc": 1
            },
            "Broken": {
              "theOtherShard": 1
            }
          }
        }
      }
      anden(mongod-2.5.0-pre-)[PRIMARY/SHARDING-rs1] test> db.test.insert({foo: "bar"})
      Inserted 1 record(s) in 1ms
      anden(mongod-2.5.0-pre-)[PRIMARY/SHARDING-rs1] test> db.runCommand({getLastError:1,w:"AllDC",wtimeout: 1000});
      {
        "n": 0,
        "lastOp": Timestamp(1365655128, 1),
        "connectionId": 417,
        "wtimeout": true,
        "waited": 1000,
        "writtenTo": [
          {
            "_id": 0,
            "host": "anden.local:31200",
            "tags": {
              "dc": "ny",
              "server": "0"
            }
          },
          {
            "_id": 1,
            "host": "anden.local:31201",
            "tags": {
              "dc": "hobo",
              "server": "1",
              "theOtherShard": "doesntHaveThisTag"
            }
          },
          {
            "_id": 2,
            "host": "anden.local:31202",
            "priority": 0,
            "tags": {
              "dc": "sf",
              "server": "2"
            }
          }
        ],
        "err": "timeout",
        "ok": 1
      }
      anden(mongod-2.5.0-pre-)[PRIMARY/SHARDING-rs1] test>

      Note that using the "AnyDC" tag works fine.

        Attachments

          Activity

            People

            • Votes:
              1 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: