-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: 2.0.1
-
Component/s: Replication
-
Environment:Linux 2.6.32-35-server, Ubuntu 10.04, MongoDB 2.0.1, Replicaset with 3 Nodes, NUMA, 2x XEON E5620 , 24 GB RAM
-
Linux
What we want to do:
We have a 3 Node replicaset and we want to add another node which should be dedicated for backups. This backup machine is not as powerful as the productive nodes.
What error do we get:
After we added the clean backup node to the set, it does the initial sync and after some time we get an duplicate error:
Wed Nov 16 11:02:49 [rsSync] replSet syncTail: 11000 E11000 duplicate key error index: keywords.keywordAccountMappings.$accountId_1 dup key: { : 1323880 }, syncing: { ts: Timestamp 1321392524000|36, h: -5191181626474352236, op: "i", ns: "keywords.keywordAccountMappings", o: { _id: ObjectId('4ec2d98c1820b45cca0fe5dc'), accountId: 1323880, keywords: [
] } }
Differences between old nodes and the new node:
the new node has a slower IO system, just 12 GB ram, a slight slower cpu and there is a 2nd mongod shard instance running, which backups another replicaset.
On the old nodes we have the mongodb index version 0 (1.8) and the new backup node has the latest index version 1 (2.0).
What we suspect that the use of $addToSet in combination with upsert might cause the replication errors:
This code creates a new keyword to the keywordAccountMappings:
$keywordAccountMappingBeanCollection->update(
array(
'accountId' => $accountId
),
array(
'$addToSet' => array(
'keywords' => array(
'keyword' => new \MongoId($keywordId),
'createdAt' => new \MongoDate(time())
)
)
),
array(
'upsert' => true,
'safe' => true
)
};
we also have an mms account assigned with my user account.