[SERVER-37306] Oplog update operation format Created: 25/Sep/18  Updated: 27/Oct/23  Resolved: 25/Sep/18

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: tonyz Assignee: Nick Brewer
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: PNG File 屏幕快照 2018-09-21 上午9.41.00.png    
Operating System: ALL
Participants:

 Description   

 The common oplog format for update operation is like this, has `o.$set` field:

 

{"ts":Timestamp(1521530692,1),"t":NumberLong("5"),"h":NumberLong("-384939294837368966"), "v":2,"op":"u","ns":"foo.bar","o2":{"_id":"L0KB$fjfLFra"},"o":{"$set":{"apns":"[]"}}}

but after some times (around 2.1M log entries now), there exists one log:

 

 

db.getCollection("oplog.rs").find({op: 'u', 'o.$set': { $exists: false}})

is this a bug?

 

 



 Comments   
Comment by Nick Brewer [ 25/Sep/18 ]

tonyz Thanks for your report. I believe you're seeing this because the $set operator was not used to update the document; this is expected if the document was overwritten entirely as opposed to just a single field being changed.

Since this behavior doesn't demonstrate a bug in MongoDB, I'll close this ticket. For MongoDB-related support discussion please post on the mongodb-user group or Stack Overflow with the mongodb tag. A question like this involving more discussion would be best posted on the mongodb-user group.

-Nick

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