[SERVER-49307] In changelog, report the shard name (& server host:port) for the shard that owns the chunk, instead of CSRS replica set name (& CSRS primary host:port) Created: 03/Jul/20  Updated: 29/Oct/23  Resolved: 23/Jul/20

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

Type: Improvement Priority: Major - P3
Reporter: Linda Qin Assignee: Janna Golden
Resolution: Fixed Votes: 0
Labels: sharding-wfbf-day
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Documented
is documented by DOCS-13786 Investigate changes in SERVER-49307: ... Closed
Related
is related to SERVER-35639 Changelog entries should include port Closed
is related to SERVER-36411 Changelog entries should include shar... Closed
Backwards Compatibility: Fully Compatible
Sprint: Sharding 2020-07-27
Participants:

 Description   

After a chunk is split, a split event will be recorded in the config.changelog collection. Currently the shard name & server name recorded in this changelog is the replica set of CSRS and host:port of the CSRS primary.

	"_id" : "CSRS_primary_host:CSRS_primary_port-XXX-YYY",
	"server" : "CSRS_primary_host:CSRS_primary_port",
	"shard" : "config",

It would be nice if the shard name & server could be the shard that owns the chunk. This would help to check the split activities on the shards and might help to identify hot shards etc.



 Comments   
Comment by Janna Golden [ 23/Jul/20 ]

The "server" and "shard" fields currently refer to which node is "making the change". In the case of split and merge, it is actually the config server since the config server changes the metadata and writes to the changelog collection. In case any downstream users might rely on this meaning, I've added a new field to the "details" field of changelog entries for split and merge called "owningShard" rather than change what "server" and "shard" represent here.

An entry for a commit operation will now look something like:

{
  "_id" : "CSRS_primary_host:CSRS_primary_port-XXX-YYY",
  "server" : "CSRS_primary_host:CSRS_primary_port",
  "shard" : "config",
  "time" : ISODate("2020-23-07T00:00:00.00"),
  "what" : "split",
  "ns" : "db.collection",
  "details" : {
    "before" : {
       ...
    },
    "left" : {
       ...
    },
    "right" : {
       ...
    },
    "owningShard": shardId
 }
}

Comment by Githook User [ 23/Jul/20 ]

Author:

{'name': 'jannaerin', 'email': 'golden.janna@gmail.com', 'username': 'jannaerin'}

Message: SERVER-49307 Add owning shard name to changelog entry for split and merge chunk
Branch: master
https://github.com/mongodb/mongo/commit/e98d20b581fd7c57d0c2cded4392adbbf0704c7b

Generated at Thu Feb 08 05:19:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.