-
Type: Bug
-
Resolution: Done
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Replication, WiredTiger
-
Storage Execution
-
ALL
-
v4.2, v4.0
-
-
Repl 2019-12-02
Single replica set transactions should respect the writeConcern option j:false.
Sharded transactions will be handled in SERVER-37364, where we specify that commitTransaction can return as soon as the decision is written with the client's requested writeConcern. Some component writes must still be performed with {w:"majority", j: true}.
Original description:
There is a call to fdatasync per transaction with j:false in the startTransaction write concern. I prefer to have an option to do transactions without fsync/fdatasync per commit. The current behavior isn't documented, and it doesn't seem right to accept j:false in the write concern but then ignore it.
I have been testing this with a single-node replica set and w:1 and what I see is:
- insert rate without transactions is better with j:false than j:true as expected
- insert rate with transactions is same for j:false vs j:true, this isn't expected
- fdatasync/commit is done with transactions regardless of value for j
Docs for startTransaction don't explain why fsync on commit would always be done – https://docs.mongodb.com/manual/reference/method/Session.startTransaction/
Docs for writeConcern also don't explain this - https://docs.mongodb.com/manual/reference/write-concern/