-
Type:
Question
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: 3.6.8
-
Component/s: Sharding
-
None
-
Server Triage
mongo shard config server, when a shard call a rpc ConfigSvrSplitChunkCommand, the config primary server do this, other config secondary servers not do. the primary server does insert config.chunks collection, and insert config.changelog, insert oplog with changelog inserted, but not insert oplog with chunks. In fact, the config secondary servers has the newest chunks document.
chunk split code follows:
configsvr_split_chunk_command.cpp:ConfigSvrSplitChunkCommand
// code placeholder // apply the batch of updates to local metadata Status applyOpsStatus = Grid::get(opCtx)->catalogClient()->applyChunkOpsDeprecated( opCtx, updates, preCond, ns.ns(), mergeVersion, WriteConcernOptions(), repl::ReadConcernLevel::kLocalReadConcern); if (!applyOpsStatus.isOK()) { return applyOpsStatus; } // log changes BSONObjBuilder logDetail; { BSONArrayBuilder b(logDetail.subarrayStart("merged")); for (auto chunkToMerge : chunksToMerge) { b.append(chunkToMerge.toConfigBSON()); } } collVersion.addToBSON(logDetail, "prevShardVersion"); mergeVersion.addToBSON(logDetail, "mergedVersion"); Grid::get(opCtx) ->catalogClient() ->logChange(opCtx, "merge", ns.ns(), logDetail.obj(), WriteConcernOptions()) .transitional_ignore(); return applyOpsStatus;
my problem, when chunk split, the config secondary chunks how to be added, where is the code called. please help, thank you.