I have a set of documents containing counters that are periodically incremented using an upsert $inc command.
I have several nodes as part of a sharded cluster.
With sharding switched off for the database, all updates seem to work fine and the counters are incremented correctly.
As soon as I enable sharding for the database and its collections, the vast majority of updates seem to be discarded. Even when I set write concern to 1, and I get a write receipt like this, which seems to indicate the write succeeded, it still doesn't increment the counter:
{ writeback: 51dc4e950000000000014aa2,
writebackSince: 574,
instanceIdent: 'mongobig-4-1:27018',
updatedExisting: true,
n: 1,
lastOp: { _bsontype: 'Timestamp', low_: 16, high_: 1373393554 },
connectionId: 925,
err: null,
ok: 1 }
What is happening to the update commands when sharding?