Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
3.7.4
-
None
-
Replication
-
ALL
Description
ses = db.getMongo().startSession()
|
dbs = ses.getDatabase("test")
|
|
|
printjson(dbs.createCollection("c", {writeConcern: {w: "majority"}}))
|
|
|
print("TRANSACTION 1")
|
printjson(ses.startTransaction())
|
printjson(dbs.c.insert({_id: 0}))
|
printjson(ses.commitTransaction())
|
|
|
print("TRANSACTION 2")
|
printjson(ses.startTransaction())
|
printjson(dbs.c.insert({_id: 1}))
|
printjson(ses.commitTransaction())
|
The second transaction fails with
assert: command failed: {
|
"operationTime" : Timestamp(1524048246, 2),
|
"ok" : 0,
|
"errmsg" : "WriteConflict",
|
"code" : 112,
|
"codeName" : "WriteConflict",
|
"$clusterTime" : {
|
"clusterTime" : Timestamp(1524048246, 3),
|
"signature" : {
|
"hash" : BinData(0,"AAAAAAAAAAAAAAAAAAAAAAAAAAA="),
|
"keyId" : NumberLong(0)
|
}
|
}
|
}
|
Attachments
Issue Links
- duplicates
-
SERVER-34195 Support speculative readConcern behavior in transactions
-
- Closed
-