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

feat(bulk-load): bulk load succeed part2 - meta handle bulk load succeed #508

Merged
merged 9 commits into from
Jun 24, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Jun 18, 2020

The whole bulk load succeed process is like:

  1. meta server set app and all partitions bulk load status is succeed feat(bulk-load): bulk load ingestion part6 - meta handle bulk_load_response during ingestion #500
  2. meta server send bulk_load_request to primary feat(bulk-load): meta server send bulk load request #457
  3. primary handle bulk_load_request feat(bulk-load): bulk load succeed part1 - replica handle bulk load succeed #502
  4. primary broadcast request to secondary feat(bulk-load): group bulk load request in replica group #460
  5. secondary handle bulk_load_request feat(bulk-load): bulk load succeed part1 - replica handle bulk load succeed #502
  6. secondary report cleanup flag to primary feat(bulk-load): bulk load succeed part1 - replica handle bulk load succeed #502
  7. primary report group cleanup flag to meta server feat(bulk-load): bulk load succeed part1 - replica handle bulk load succeed #502
  8. meta handle bulk load succeed

This pull request is about meta handle bulk load succeed, step 8 above.

meta handle bulk_load_response in handle_bulk_load_finish

  • if all replicas in group cleaned up bulk load state, set _partitions_cleaned_up[pid] = true and _apps_in_progress_count[app_id] - 1
  • if all partitions cleaned up, remove bulk load directory(in function remove_bulk_load_dir_on_remote_storage), reset local bulk load states(in function reset_local_bulk_load_states), set app's is_bulk_loading as false (in function update_app_not_bulk_loading_on_remote_storage), whole bulk load process finished

Tips:
when app's is_bulk_loading = false, meta will not send bulk load request to replica server any more in function try_resend_bulk_load_request #463

@hycdong hycdong marked this pull request as ready for review June 18, 2020 05:45
levy5307
levy5307 previously approved these changes Jun 22, 2020
src/dist/replication/meta_server/meta_bulk_load_service.h Outdated Show resolved Hide resolved
src/dist/replication/meta_server/meta_bulk_load_service.h Outdated Show resolved Hide resolved

bool group_cleaned_up = response.is_group_bulk_load_context_cleaned_up;
ddebug_f("receive bulk load response from node({}) app({}) partition({}), primary status = {}, "
"is_group_bulk_load_context_cleaned_up = {}",
Copy link
Contributor

@neverchanje neverchanje Jun 22, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please tell a meaningful message in the log so that we can learn what "is_group_bulk_load_context_cleaned_up" means.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the replica group will succeed without their states cleared?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when partition finish ingesting, its status will turn ingesting -> succeed, meta will still send bulk_load_request to replica, replica will turn ingesting -> succeed and cleanup its bulk load context, replica status should be invalid when it clean up bulk load status not succeed.

neverchanje
neverchanje previously approved these changes Jun 22, 2020

bool group_cleaned_up = response.is_group_bulk_load_context_cleaned_up;
ddebug_f("receive bulk load response from node({}) app({}) partition({}), primary status = {}, "
"is_group_bulk_load_context_cleaned_up = {}",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the replica group will succeed without their states cleared?

@hycdong hycdong dismissed stale reviews from neverchanje and levy5307 via a2a1d93 June 22, 2020 09:51
neverchanje
neverchanje previously approved these changes Jun 23, 2020
acelyc111
acelyc111 previously approved these changes Jun 23, 2020
@neverchanje neverchanje merged commit ed267e2 into XiaoMi:master Jun 24, 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