[SERVER-68503] Revisit oplog format for op=n no-op entry for $wouldChangeOwningShard Created: 02/Aug/22  Updated: 17/Nov/23

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

Type: Task Priority: Major - P3
Reporter: Abdul Qadeer Assignee: Backlog - Cluster Scalability
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Assigned Teams:
Cluster Scalability
Participants:
Story Points: 3

 Description   

As part of SERVER-67492, it was found that the following "op" = "n" oplog entry with empty "o2" field and "o" value as "$wouldChangeOwningShard" : 1 is created when "featureFlagUpdateDocumentShardKeyUsingTransactionApi" feature flag is set for "findAndModify" command:

{
	"lsid" : {
		"id" : UUID("d7bf4672-6df6-4ab3-9aa5-738a68c4fbb2"),
		"uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
	},
	"txnNumber" : NumberLong(62),
	"op" : "n",
	"ns" : "test0_fsmdb0.fsmcoll0",
	"ui" : UUID("723d67f7-ce95-4812-9171-07c39130c567"),
	"o" : {
		"$wouldChangeOwningShard" : 1
	},
	"o2" : {
 
	},
	"stmtId" : 0,
	"fromMigrate" : true,
	"ts" : Timestamp(1658761337, 107),
	"t" : NumberLong(1),
	"v" : NumberLong(2),
	"wall" : ISODate("2022-07-25T15:02:17.027Z"),
	"prevOpTime" : {
		"ts" : Timestamp(0, 0),
		"t" : NumberLong(-1)
	}
} 

On the other hand, "op" = "n" with an empty "o2" field and "fromMigrate:true" indicates a pre/postImage oplog entry which can be easily mixed together with "$wouldChangeOwningShard" : 1 case above:

{
        "lsid" : {
                "id" : UUID("77972370-47d2-40c6-a786-c91e17c90e9c"),
                "uid" : BinData(0,"47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=")
        },
        "txnNumber" : NumberLong(30),
        "op" : "n",
        "ns" : "test5_fsmdb0.fsmcoll0",
        "ui" : UUID("9b26f8b6-ab52-4d92-8309-7ca77213d083"),
        "o" : {
                "_id" : 450,
                "skey" : 511,
                "tid" : 2,
                "counter" : 1
        },
        "o2" : {
 
        },
        "stmtId" : 0,
        "fromMigrate" : true,
        "ts" : Timestamp(1654658045, 197),
        "t" : NumberLong(34),
        "v" : NumberLong(2),
        "wall" : ISODate("2022-06-08T03:14:05.522Z"),
        "prevOpTime" : {
                "ts" : Timestamp(0, 0),
                "t" : NumberLong(-1)
        }
} 

It would be great if we can consolidate oplog format to avoid handling special cases in code in order to make the code more maintainable over time.

 


Generated at Thu Feb 08 06:10:59 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.