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

feat(split): add split_status #641

Merged
merged 4 commits into from
Oct 15, 2020
Merged

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Oct 14, 2020

This pull request adds two sturctures to show split status.

split_status (in replication.thirft)

Define five split_status for partition (not_split, splitting, pausing, paused, canceling), both replica and meta will use it.

  • For replica, we used to use _child_gpid to distinguish whether a replica is executing splitting, if _child_gpid.get_app_id() > 0, the replica is splitting, otherwise not. It can only show two split status. Now, we use _split_status to describe partition split status.
  • For meta, see split_state

split_state (in meta_data.h)

Define sturct split_state to show app split progress, this sturcture include splitting partition count and each split_status for those splitting partitions. If splitting_count = 0, it means current app is not splitting or has finished splitting.

This sturcture is helpful to query app split progress and easier to understand. In previous implementation, when an app is executing splitting, tha ballot of not-ready child partition is invalid_ballot( < 0), so we should traverse app->partitions to check if any partition whose ballot is invalid. Now, we just check the value of splitting_count.

This pr also update related unit tests.

@hycdong hycdong marked this pull request as ready for review October 14, 2020 02:07
@hycdong hycdong changed the title feat(split): add partition split_status feat(split): add split_status Oct 14, 2020
@foreverneverer
Copy link
Contributor

The file seem not be named xxxmanager, since it does not any manager work, may you can named better name later

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.

4 participants