Show
Hello, I found the following that I think is inconsistent:
const dbName = "testDB" ;
const collName = "testColl" ;
const namespace = `${dbName}.${collName}`;
const primary = replTest.getPrimary();
const session = primary.startSession();
let testDB = session.getDatabase(dbName);
testDB.dropDatabase();
let client = new EncryptedClient(testDB.getMongo(), dbName);
assert .commandWorked(client.createEncryptionCollection(collName, {
validator: {$jsonSchema: {required: [ "x" ]}},
encryptedFields: {
"fields" : [
{ "path" : "x" , "bsonType" : "string" , "queries" : { "queryType" : "equality" }},
{ "path" : "y" , "bsonType" : "string" },
]
}
}));
for (let i = 0 ; i < 2 ; ++i) {
let res = assert .commandWorked( this .testDB.runCommand(
{
insert: collName,
documents: [{_id: 3 , x: "0" }],
writeConcern: {w: "majority" },
lsid: session.getSessionId()
txnNumber: NumberLong( 10 )
});
print(tojson(res));
}
for (let i = 0 ; i < 2 ; ++i) {
let res = assert .commandWorked( this .testDB.runCommand(
{
update: collName,
updates: [{q: {_id: 1 }, u: {$set: { "a.$[i].b" : 7 , x: "2" }}, arrayFilters: [{ "i.b" : 6 }]}],
writeConcern: {w: "majority" },
lsid: session.getSessionId()
txnNumber: NumberLong( 11 )
});
print(tojson(res));
}
For the retry of the insert, the response is
{
"n" : 1 ,
"electionId" : ObjectId( "7fffffff0000000000000001" ),
"opTime" : {
"ts" : Timestamp( 1697145867 , 1 ),
"t" : NumberLong( 1 )
},
"ok" : 1 ,
"$clusterTime" : {
"clusterTime" : Timestamp( 1697145868 , 9 ),
"signature" : {
"hash" : BinData( 0 , "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),
"keyId" : NumberLong( 0 )
}
},
"operationTime" : Timestamp( 1697145868 , 9 )
}
But for update, there is a retriedStmtIds field:
{
"n" : 1 ,
"electionId" : ObjectId( "7fffffff0000000000000001" ),
"opTime" : {
"ts" : Timestamp( 1697145867 , 1 ),
"t" : NumberLong( 1 )
},
"retriedStmtIds" : [
2
],
"nModified" : 1 ,
"ok" : 1 ,
"$clusterTime" : {
"clusterTime" : Timestamp( 1697145869 , 6 ),
"signature" : {
"hash" : BinData( 0 , "AAAAAAAAAAAAAAAAAAAAAAAAAAA=" ),
"keyId" : NumberLong( 0 )
}
},
"operationTime" : Timestamp( 1697145869 , 6 )
}