Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

feat(split): update register_child with split_status #643

Merged
merged 4 commits into from
Oct 21, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Oct 15, 2020

When a parent partition finish, primary parent will send register_child request to meta server, meta server will update child configuration on remote storage and reply response to primary parent, then primary will make child active and update parent group partition_count.

In pr #641, we add split_status to show partition split status, this pull request updates register child progress with split_status.

  1. Add replica split status check when primary parent send register_child request
  2. When meta register child
  • check if child registered by split_status
  • add split status check, if parent is not splitting status, return invalid_state in response
  1. When primary replica receive response
  • In previous implemetation:
    • error = ERR_INVALID_VERSION: no nothing
    • error = ERR_IO_PENDING or other rpc errors such as ERR_TIMEOUT: delay and resend register request to meta server
    • error = ERR_CHILD_REGISTERED: cleanup parent split context and update parent partition_configuration
    • error = ERR_OK: make child active, update parent group partition, and cleanup parent split context and update parent partition_configuration
  • In current implementation:
    • error = ERR_INVALID_VERSION or ERR_INVALID_STATE: split failed because register child failed, handle parent and child split failed, and update parent partition_configuration
    • error = ERR_OK: add ballot check: if ballot out-dated, delay and resend register request to meta server
    • other error handle is same as pervious implementation, just adjust code executing sequence

Besides, this pull request also updates related unit tests.

@hycdong hycdong marked this pull request as ready for review October 15, 2020 07:32
@acelyc111 acelyc111 merged commit a64c2f6 into XiaoMi:master Oct 21, 2020
@hycdong hycdong deleted the update_register_child branch October 29, 2020 07:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants