Hi Mike,
I want to confirm that I understand your question and observations; please let me know if I am mistaken-
When you issue an update on a document, the server returns writeResult 0 to the thread that performed the update. You can confirm that the thread is responsible for the update because each thread has a unique DATA_ID. Here is my understanding of the situation in pseudocode:
{code}
{_id: x, TIMESTAMP: t0, DATA_ID: d0}
doc = find({_id: x})
time = doc.TIMESTAMP = t0
do_something(doc)
doc = {_id: x, TIMESTAMP: t1, DATA_ID: d1}
result = coll.update({_id:x, TIMESTAMP: t0}, doc)
getN() returns 0
find({_id: x}) -> {_id:x, TIMESTAMP: t1, DATA_ID: d1}
{code}
If my understanding is correct, could you tell us what driver you're using? Are you using writeResult.safe, or are you calling getLastError() manually? Can you confirm that there's no way another thread could have been responsible for this write- any chance the same DATA_ID is being used more than once? Additional information about the way DATA_ID is generated would be helpful.
On Tuesday, October 9, 2012 6:01:02 PM UTC-4, Mike Craig wrote: