Uploaded image for project: 'Java Driver'
  1. Java Driver
  2. JAVA-628

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

    XMLWordPrintableJSON

Details

    • Icon: Task Task
    • Resolution: Done
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.7.3
    • API
    • None
    • MongoDB 2.0.3
      Linux

    Description

      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.

      Attachments

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

        Activity

          People

            Unassigned Unassigned
            solowu@cisco.com Solomon Wu
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: