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

feat(bulk-load): pause bulk load part2 - implement bulk load pause #518

Merged
merged 2 commits into from
Jul 2, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Jun 29, 2020

Pause bulk load process is like:

  1. client sends pause request to meta server, and meta server update app and partitions' bulk load status to pausing feat(bulk-load): pause bulk load part1 - add control_bulk_load rpc and start to pause bulk load #514
  2. meta server still broadcast pause bulk load to replica server through bulk_load_request feat(bulk-load): meta server send bulk load request #457
  3. primary handle bulk_load_request
  4. primary broadcast request to secondary feat(bulk-load): group bulk load request in replica group #460
  5. secondary handle bulk_load_request
  6. secondary report is_paused flag to primary
  7. primary report group is_paused flag to meta server
  8. meta handle bulk load paused

This pull request is about the remaining part of the process.

  • replica handle bulk_load_request
    • when bulk load status of request is pausing, replica will try to cleanup all downloading tasks and turn status to paused (in function pause_bulk_load)
    • secondary report is_paused flag to primary (in function report_bulk_load_states_to_primary)
    • primary report group is_paused flag to meta server (in function report_group_is_paused)
  • meta server handle bulk load paused
    • handle bulk_load_response in function handle_app_pausing
    • if all replicas in group paused bulk load, set partition bulk load status as paused
    • if all partitions bulk load status is paused, set app bulk load status as paused (in function update_partition_status_on_remote_storage_reply)

Special explanations:

  1. It is possible for is_group_bulk_load_paused is not set in function handle_app_pausing, the possible condition:
    • app and partition bulk load status is downloading, meta send request to replica, replica server report download progress to meta server, at this time, bulk load is paused, app bulk load status has been updated to pausing, meta will call function handle_app_pausing, and is_paused flag is not set in this response, meta will do nothing with this response, and resend bulk_load_request to replica.
  2. When app status is paused, meta server will not resend request to replica server in function on_partition_bulk_load_reply, related pull request is feat(bulk-load): meta handle bulk_load_response #463

@hycdong hycdong marked this pull request as ready for review June 29, 2020 06:17
@levy5307 levy5307 merged commit 2ecb77f into XiaoMi:master Jul 2, 2020
@hycdong hycdong deleted the pause_bulk_load branch July 2, 2020 03:54
hycdong added a commit to hycdong/rdsn that referenced this pull request Jul 6, 2020
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