Read after WriteConcern.SAFE does not guarantee to be able to get data?

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Minor - P4
    • None
    • Affects Version/s: 2.7.3
    • Component/s: API
    • None
    • Environment:
      MongoDB 2.0.3
      Linux
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      3 nodes are involved

      • 1 mongo node - no replica set
      • 2 of our application node. let's call the first node appserver node, and the second node worker node.
      • using mongo Java driver

      steps
      1. appserver node writes to mongo with WriteConcern.SAFE.
      2. appserver sends a message to worker node
      3. upon receiving the message, worker node tries to read the data from mongo. the data that appserver just wrote is not there.

      from our understanding of the document, Writeconcern.safe is equivalent of calling getLastError(). the subsequent read should be able to read the data just written. if we write with writeconern.normal, the subsequent read is not guaranteed to be able to read the data just written. but if we write with writeconern.safe, we should be able to read the data.

        1. ok.txt
          2 kB
        2. problem.txt
          7 kB
        3. update.txt
          108 kB
        4. update_1.txt
          53 kB

              Assignee:
              Unassigned
              Reporter:
              Solomon Wu
              None
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: