-
Notifications
You must be signed in to change notification settings - Fork 58
Conversation
// Used to deliver child gpid during partition split | ||
6:optional dsn.gpid child_gpid; | ||
// Used to deliver child gpid and meta_split_status during partition split | ||
6:optional dsn.gpid child_gpid; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How primary knows its child_gpid? I think it certainly can calculates out on its own gpid.
Such as parent_gpid(1, 4) => child_gpid(1, 4+PARTITION_COUNT)
If primary can, the secondary can too. Primary does not have to sync this knowledge to secondaries.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Primary calculate child_gpid in trigger_primary_parent_split
, if it found the partition_count sync from meta server is double of its own value:
rdsn/src/replica/split/replica_split_manager.cpp
Lines 1136 to 1140 in d850ee7
auto child_gpid = | |
gpid(get_gpid().get_app_id(), | |
get_gpid().get_partition_index() + _replica->_app_info.partition_count); | |
add_child_request.__set_child_gpid(child_gpid); | |
parent_start_split(add_child_request); |
It is a safe solution to sync it to secondary, if any bug happened, such as duplicated split, secondary may get wrong child_gpid, leading dangerous result.
I'd recommend add some comments on the |
Simple partition split process
More partition split discussion in issue #69 and partition split design doc
This pr solves the part of third step of partition split, which is bold in process description.
What this pr solve
Primary parent notices that it should start partition split by
on_config_sync
, then it will pass it to secondary through group_check by callingbroadcast_group_check
, and put split related filed ingroup_check_request
, when secondary receives this request, it will calltrigger_secondary_parent_split
.