Hide
1. Initialize replica set like this:
2. Add a row, using w:2 (works)
db.test.insert({x:1}, { writeConcern : { w:2, wtimeout: 15000 }})
3. Reconfigure replica set with this configuration:
4. Assuming the same server is primary before and after the reconfig, this will work:
db.test.insert({x:2}, { writeConcern : { w:2, wtimeout: 15000 }})
5. Failover to the server on 27002 (rs.stepDown())
6. This operation times out:
db.test.insert({x:3}, { writeConcern : { w:2, wtimeout: 15000 }})
7. Fail back to 27001
8. This works again:
db.test.insert({x:2}, { writeConcern : { w:2, wtimeout: 15000 }})
Show
1. Initialize replica set like this:
{
"_id" : "test",
"version" : 1,
"members" : [
{
"_id" : 0,
"host" : "myServer:27001",
"priority" : 50
},
{
"_id" : 1,
"host" : "myServer:27002",
"priority" : 50
},
{
"_id" : 2,
"host" : "myServer:27003",
"priority" : 0
},
{
"_id" : 3,
"host" : "myServer:27004",
"priority" : 10
},
]
}
2. Add a row, using w:2 (works)
db.test.insert({x:1}, { writeConcern : { w:2, wtimeout: 15000 }})
3. Reconfigure replica set with this configuration:
{
"_id" : "test",
"version" : 2,
"members" : [
{
"_id" : 0,
"host" : "myServer:27001",
"priority" : 50
},
{
"_id" : 1,
"host" : "myServer:27002",
"priority" : 50
},
{
"_id" : 2,
"host" : "myServer:27003",
"priority" : 0
}
]
}
4. Assuming the same server is primary before and after the reconfig, this will work:
db.test.insert({x:2}, { writeConcern : { w:2, wtimeout: 15000 }})
5. Failover to the server on 27002 (rs.stepDown())
6. This operation times out:
db.test.insert({x:3}, { writeConcern : { w:2, wtimeout: 15000 }})
7. Fail back to 27001
8. This works again:
db.test.insert({x:2}, { writeConcern : { w:2, wtimeout: 15000 }})