[SERVER-23956] Inconsistent behavior between 3.2.6-rc0 and 3.3.5 for writeconcern majority and journaling Created: 27/Apr/16  Updated: 06/Dec/22  Resolved: 04/Jan/17

Status: Closed
Project: Core Server
Component/s: Replication, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Kay Kim (Inactive) Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Backports
Depends
depends on SERVER-23010 Committed Snapshot Meaning Incorrect Closed
Related
related to SERVER-22276 implement "j" flag in write concern a... Closed
related to SERVER-27368 Balancer not working on 3.4 Closed
related to SERVER-22533 Enable ReadConcern.Majority tests wit... Closed
Assigned Teams:
Replication
Backport Requested:
v3.2
Sprint: Repl 2017-01-23
Participants:
Linked BF Score: 0

 Description   

So, if I start primary with journaling and secondaries with no journaling:

./mongodb-3.2.6-rc0-enterprise/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs1/db --logpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs1/mongod.log --port 27017 --logappend --fork 
./mongodb-3.2.6-rc0-enterprise/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs2/db --logpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs2/mongod.log --port 27018 --logappend --fork --nojournal 
./mongodb-3.2.6-rc0-enterprise/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs3/db --logpath /Users/kay/mongo/data/mongodb-3.2.6-rc0-enterprise/replset/rs3/mongod.log --port 27019 --logappend --fork --nojournal  

Then after initiating the replica set and adding members,

MongoDB Enterprise replset:PRIMARY> db.foo.insert( { x: 1 }, { writeConcern: { w: "majority" } } )
WriteResult({ "nInserted" : 1 })
MongoDB Enterprise replset:PRIMARY> db.foo.insert( { x: 1 }, { writeConcern: { w: "majority", j: true } } )
WriteResult({ "nInserted" : 1 })

But, using 3.3.5 version

./mongodb-3.3.5/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs1/db --logpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs1/mongod.log --port 27017 --logappend --fork 
./mongodb-3.3.5/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs2/db --logpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs2/mongod.log --port 27018 --logappend --fork --nojournal
./mongodb-3.3.5/bin/mongod --replSet replset --dbpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs3/db --logpath /Users/kay/mongo/data/mongodb-3.3.5/replset/rs3/mongod.log --port 27019 --logappend --fork --nojournal 

The operation hangs because secondaries do not have journaling

replset:PRIMARY>  db.foo.insert( { x: 1 }, { writeConcern: { w: "majority" } } )
replset:PRIMARY> db.foo.insert( { x: 1 }, { writeConcern: { w: "majority" , j: true } } )



 Comments   
Comment by Spencer Brody (Inactive) [ 04/Jan/17 ]

Spoke with schwerin about this and we decided that since this is a potentially breaking change for some users, it's too destabilizing to include in such a late 3.2 release.

Comment by Eric Milkie [ 24/Aug/16 ]

I believe this behavior is still expected because the final set of code changes that changed the behavior of mixed durabilities replica sets was not backported to 3.2.

Generated at Thu Feb 08 04:04:56 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.