-
Type: Bug
-
Resolution: Done
-
Priority: Critical - P2
-
Affects Version/s: None
-
Component/s: Replication
-
None
-
ALL
if a change occurs we need to be careful about backward compatibility / mixing of versions with replication, which is common.
Jason Toffaletti to mongodb-user
show details 4:42 AM (4 hours ago)
I started up a mongod v1.4.4 with --master and ran some multi-field
updates like this from mongo shell:
> db.test2.update(
{thing:'stuff'}, {$set:
{stuff:14}, $inc:{version:1}})
While doing this I have a pymongo 1.5.1 script running a tailable
cursor on local.oplog.$main, printing out results:
update {u'o2':
{u'_id': ObjectId('4c610b301a632ffb5161c3e8')}, u'ns':
u'test.test2', u'ts': Timestamp(1281428434, 1), u'o': {u'$set':
{u'version': 2.0}}, u'op': u'u'}
update {u'o2':
, u'ns':
u'test.test2', u'ts': Timestamp(1281428450, 1), u'o': {u'$set':
{u'version': 3.0}}, u'op': u'u'}
update {u'o2':
, u'ns':
u'test.test2', u'ts': Timestamp(1281428586, 1), u'o': {u'$set':
{u'version': 4.0}}, u'op': u'u'}
This is strange, the "o" field only shows the update to version. What
does mongo shell show?
> db['oplog.$main'].find(
{op:"u"})
{ "ts" :
, "op" : "u", "ns" :
"test.test2", "o2" :
,
"o" : { "$set" :
, "$set" :
{ "stuff" : 1 } } }
{ "ts" :
, "op" : "u", "ns" :
"test.test2", "o2" :
,
"o" : { "$set" :
, "$set" :
{ "stuff" : 1346 } } }
{ "ts" :
, "op" : "u", "ns" :
"test.test2", "o2" :
,
"o" : { "$set" :
, "$set" :
{ "stuff" : 14 }} }
Wait, what? This doesn't have the version update, but shows the $set
twice. I know mongod replication works, so I must be doing something
wrong?
- is duplicated by
-
SERVER-7871 Updates create $set operations in oplog in a new format that is not parseable by most drivers
- Closed
-
SERVER-8605 Oplog contains missing information ?
- Closed
- is related to
-
SERVER-7871 Updates create $set operations in oplog in a new format that is not parseable by most drivers
- Closed
-
SERVER-10162 Eliminate repeated $set/$unset in new update framework oplog generation
- Closed
-
SERVER-718 in JS shell, duplicated fields should print correctly
- Closed
-
SERVER-6399 Refactor update() code
- Closed