Details
-
Bug
-
Resolution: Won't Do
-
Major - P3
-
None
-
None
-
ALL
-
Sharding 2019-12-16, Sharding 2019-12-30, Sharding 2020-01-13
Description
Presumably this error is returned because WC timeout is considered a retryable error?
assert: write failed with error: {
|
"nMatched" : 0,
|
"nUpserted" : 0,
|
"nModified" : 0,
|
"writeError" : {
|
"code" : 217,
|
"errmsg" : "Cannot retry a retryable write that has been converted into a transaction"
|
}
|
}
|
(function() {
|
'use strict';
|
|
|
load("jstests/libs/write_concern_util.js");
|
load("jstests/sharding/libs/update_shard_key_helpers.js");
|
|
|
const st = new ShardingTest({mongos: 1, shards: {
|
rs0: {
|
nodes: [{}, {}, {rsConfig: {tags: {tag1: "value1"}}}],
|
settings: {getLastErrorModes: {tagged: {tag1: 1}}}
|
},
|
rs1: {nodes: 3}
|
}});
|
const wc = {w: "tagged", wtimeout: 6000};
|
const kDbName = 'db';
|
const mongos = st.s0;
|
const shard0 = st.shard0.shardName;
|
const shard1 = st.shard1.shardName;
|
const ns = kDbName + '.foo';
|
|
|
assert.commandWorked(mongos.adminCommand({enableSharding: kDbName}));
|
st.ensurePrimaryShard(kDbName, shard0);
|
|
|
let session = st.s.startSession({retryWrites: true});
|
let sessionDB = session.getDatabase(kDbName);
|
|
|
let docsToInsert =
|
[{"x": 4, "a": 3}, {"x": 78}, {"x": 100}, {"x": 300, "a": 3}, {"x": 500, "a": 6}];
|
|
|
shardCollectionMoveChunks(st, kDbName, ns, {"x": 1}, docsToInsert, {"x": 100}, {"x": 300});
|
cleanupOrphanedDocs(st, ns);
|
|
|
// Pause replication on the tagged secondary.
|
stopServerReplication(st.rs0.nodes[2]);
|
|
|
let res = sessionDB.foo.update({x: 4}, {$set: {x: 1000}}, {writeConcern: wc});
|
// Actually fails with 217 (IncompleteTransactionHistory)
|
assert.commandWorkedIgnoringWriteConcernErrors(res);
|
checkWriteConcernTimedOut(res);
|
|
|
res = sessionDB.runCommand({
|
findAndModify: 'foo',
|
query: {x: 78},
|
update: {$set: {x: 250}},
|
lsid: {id: UUID()},
|
txnNumber: NumberLong(1),
|
writeConcern: wc,
|
});
|
// Actually fails with 217 (IncompleteTransactionHistory)
|
assert.commandWorkedIgnoringWriteConcernErrors(res);
|
checkWriteConcernTimedOut(res);
|
|
|
restartServerReplication(st.rs0.nodes[2]);
|
|
|
mongos.getDB(kDbName).foo.drop();
|
|
|
st.stop();
|
})();
|
Attachments
Issue Links
- depends on
-
SERVER-45360 Bring shell retryable error codes to parity with driver specs
-
- Closed
-
- related to
-
SERVER-44289 Retryable writes that change shard key value and owning shard that include write concern fail with InvalidOptions
-
- Closed
-