Details
-
Bug
-
Resolution: Incomplete
-
Major - P3
-
None
-
1.6.5
-
None
-
CentOs 5
-
Linux
Description
Lost Data while Master in Replica set went down
Lost data when i killed master while inserting data through mongos shell.
I don't see any rollback files in any of the data directories.
Configuration:
Replica Set dbs
mongod --fork --rest --port 30001 --replSet set1/localhost:30001,localhost:30002,localhost:30003 --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r1 --logpath /home/mongo/logs/s1r1.log
mongod --fork --rest --port 30002 --replSet set1/localhost:30001,localhost:30002,localhost:30003 --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r2 --logpath /home/mongo/logs/s1r2.log
mongod --fork --rest --port 30003 --replSet set1/localhost:30001,localhost:30002,localhost:30003 --shardsvr --oplogSize 500 --dbpath /home/mongo/data/db/s1r3 --logpath /home/mongo/logs/s1r3.log
mongod --fork --rest --port 30004 --replSet set1 --logpath /home/mongo/logs/arbiter1_set1.log --dbpath /home/mongo/data/db/s1/arbiter1 --oplogSize 500
mongod --fork --rest --port 30005 --replSet set1 --logpath /home/mongo/logs/arbiter2_set1.log --dbpath /home/mongo/data/db/s1/arbiter2 --oplogSize 500
Replica configuration:
new_config = {_id: 'set1', members: [
{_id: 0, host: 'localhost:30001'},
{_id: 1, host: 'localhost:30002'},
{_id: 2, host: 'localhost:30003'},
{_id: 3, host: 'localhost:30004',arbiterOnly: true},
{_id: 4, host: 'localhost:30005',arbiterOnly: true}]
}
Configuration Server
mongod --fork --configsvr --port 20001 --dbpath /home/mongo/data/db/config1 --logpath /home/mongo/logs/config1.log
Mongos
mongos --fork --configdb localhost:20001 --chunkSize 1 --logpath /home/mongo/logs/mongos.log
> rs.status()
{
"set" : "set1",
"date" : "Wed Dec 22 2010 14:47:07 GMT-0500 (EST)",
"myState" : 1,
"members" : [
,
,
,
,
{ "_id" : 4, "name" : "localhost:30005", "health" : 1, "state" : 7, "uptime" : 26, "lastHeartbeat" : "Wed Dec 22 2010 14:47:07 GMT-0500 (EST)" } ],
"ok" : 1
}
added sharding config through mongos
db.runCommand(
{ addshard : "set1/localhost:30001,localhost:30002,localhost:30003", name : "shard1" });
db.runCommand(
{listshards:1})
{
"shards" : [
],
"ok" : 1
}
inserted some data
use demo_contacts
db.contacts.count()
300000
Killed master while inserting data.
> db.contacts.count()
300000
> for (var i = 1; i <= 100000; i++) db.contacts.save({aid:4, contact_id:i,test_string: "This is test string to test mongodb s>
> db.contacts.count()
399981
>
~