[SERVER-10524] Add diagnostic information about multi-update/removes in oplog Created: 15/Aug/13  Updated: 06/Dec/22  Resolved: 06/Sep/18

Status: Closed
Project: Core Server
Component/s: Replication, Write Ops
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Scott Hernandez (Inactive) Assignee: Backlog - Replication Team
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Replication
Participants:

 Description   

Add an runtime ServerParameter to allow annotating fan-out operations in the oplog.

For any fan-out (multi-update/remove) we can add an operation-id to each oplog entry which results from that operation as executed on the primary. In addition we would log a no-op oplog entry with the orig. query+update ( with only the operations and their paths so we don't log the orig data completely).

With this information in the oplog we can easily detect inefficiencies in the replication process or costly operations via replication. This would also allow more explicit understanding of the root operation and its effects via replication.

Here is an example oplog sequence in this mode:

 
{ts:..., h:..., op:"n", o2:{counter:{$lt:100}}, 
 o:[
   {$push:{"a.b" : undefined}}, 
   {$inc:{"counter": undefined, version: undefined}], 
 opid:123123}
 
{ts:..., h:..., op:u, o2:{_id:y}, 
 o:{$set:{counter:56, version:3, "a.7" :{...}}} 
 opid:123123}
{ts:..., h:..., op:u, o2:{_id:x}, 
 o:{$set:{counter:200, version:12, "a.12" :{...}}} 
 opid:123123}


Generated at Thu Feb 08 03:23:22 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.