[JAVA-2846] WriteConcern.JOURNALED is not working Created: 02/May/18 Updated: 27/Oct/23 Resolved: 03/May/18 |
|
| Status: | Closed |
| Project: | Java Driver |
| Component/s: | Write Operations |
| Affects Version/s: | 3.6.3 |
| Fix Version/s: | None |
| Type: | Task | Priority: | Major - P3 |
| Reporter: | 아나 하리 | Assignee: | Unassigned |
| Resolution: | Works as Designed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
OS 3.10.0-693.21.1.el7.x86_64 #1 SMP Wed Mar 7 19:03:37 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux |
||
| Description |
|
With mongo client, we can see disk write operation for journal sync with writeconcern({w:1,j:true}).
And journal false writeconcern also.
But with java client driver, looks like no disk operations for journal sync even I set WriteConcern.JOURNALED writeconcern. And I have traced disk io system call with strace, but there's no sync operation. Below is simple test program I have used.
for both "WriteConcern.W1.withJournal(true)" and "WriteConcern.ACKNOWLEDGED.withJournal(true)", looks like mongod does not sync journal log for each write operation. Disk write operations is almost same as "{w:1, f:false}" in mongo client. |
| Comments |
| Comment by 아나 하리 [ 03/May/18 ] | |||||||||||||||||||||||||||||||||||||
|
@Jeff Yemin
Sorry, forget about this issue. I was wrong with below code. This code return FALSE always whatever cmd line value. (I don't know why, but am not interested in this.)
Regards, | |||||||||||||||||||||||||||||||||||||
| Comment by Jeffrey Yemin [ 02/May/18 ] | |||||||||||||||||||||||||||||||||||||
|
I'm not able to reproduce this. First I proved that the driver is indeed sending the correct write concern, by registering a command listener with the MongoClient:
This prints out every command sent by the driver, and the commands look like this:
So the driver is including j : true in the write concern. I also observed an increase in I/O activity during the test run:
|