-
Type: Bug
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Sharding
-
None
-
Cluster Scalability
-
ALL
-
Updates by _id are broadcasted to all shards which own chunks for the collection when the collection is not sharded by _id. Session information from any retryable writes which touched the document isn't migrated when the document's shard key value is updated. This allows the new owning shard to execute those statements a second time.
[js_test:repro_retryable_update_by_id_multiple_execution] 2021-01-28T23:10:11.492+0000 secondRes: { "nModified" : 2, "n" : 2, "ok" : 1, "$clusterTime" : { "clusterTime" : Timestamp(1611875411, 85), "signature" : { "hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="), "keyId" : NumberLong(0) } }, "operationTime" : Timestamp(1611875411, 85) } [js_test:repro_retryable_update_by_id_multiple_execution] 2021-01-28T23:10:11.492+0000 s20023| {"t":{"$date":"2021-01-28T23:10:11.440+00:00"},"s":"I", "c":"COMMAND", "id":51803, "ctx":"conn6","msg":"Slow query","attr":{"type":"command","ns":"test.mycoll","appName":"MongoDB Shell","command":{"find":"mycoll","filter":{"_id":0.0},"limit":1.0,"singleBatch":true,"lsid":{"id":{"$uuid":"b5e17cb0-ce96-436b-9523-2875959096a1"}},"$clusterTime":{"clusterTime":{"$timestamp":{"t":1611875411,"i":85}},"signature":{"hash":{"$binary":{"base64":"AAAAAAAAAAAAAAAAAAAAAAAAAAA=","subType":"0"}},"keyId":0}},"$db":"test"},"nShards":2,"cursorExhausted":true,"numYields":0,"nreturned":1,"reslen":274,"remote":"127.0.0.1:45432","protocol":"op_msg","durationMillis":0}} [js_test:repro_retryable_update_by_id_multiple_execution] 2021-01-28T23:10:11.492+0000 uncaught exception: Error: [{ "_id" : 0, "x" : 25, "counter" : 2 }] != [{ "_id" : 0, "x" : 25, "counter" : 1 }] are not equal :
- is related to
-
SERVER-54019 Session migration from moveChunk can lead to higher 'n' and 'nModified' for retryable updates by _id
- Backlog