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

feat(bulk-load): small update for meta bulk load service #548

Merged
merged 8 commits into from
Jul 13, 2020

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Jul 10, 2020

This pull request is about some small update for meta bulk load service:

  1. update function initialize_bulk_load_service and on_start_bulk_load in THREAD_POOL_META_SERVER
    • most meta functions are executing in thread pool THREAD_POOL_META_STATE, which is partitioned with only one worker, only some control functions or functions used for starting meta are executing in thread pool THREAD_POOL_META_SERVER
    • function initialize_bulk_load_service is called by start_service, it will create bulk load root directory on remote storage and try to get possible bulk load info from it synchronously, operating remote storage data should be executing in THREAD_POOL_META_STATE. if initialize_bulk_load_service executes in it, it will lead dead lock, because create_bulk_load_root_dir is a synchronous function.
    • function on_start_bulk_load will check parameters by reading files on remote file provider(fds), it should not executing in THREAD_POOL_META_STATE
  2. fix thread pool in function partition_ingestion
    • function partition_ingestion is executing in THREAD_POOL_DEFAULT, while function handle_bulk_load_failed and handle_app_unavailable should be executed in THREAD_POOL_META_STATE
  3. fix bugs in function on_control_bulk_load
    • remove useless app lock
    • call function update_app_status_on_remote_storage_unlocked directly instead of adding it into task queue

Special explanation:
In pull request #490 , I update simple_kv test case 402, this pull request I recover it into previous state.

@hycdong hycdong marked this pull request as ready for review July 10, 2020 04:36
void bulk_load_service::initialize_bulk_load_service()
{
task_tracker tracker;
error_code err = ERR_OK;
_sync_bulk_load_storage.reset(new mss::meta_storage(_meta_svc->get_remote_storage(), &tracker));
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you intend to set _sync_bulk_load_storage to a temporary tracker?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, _sync_bulk_load_storage will only be used in functions for sync bulk load info from remote storage, other operations still use _meta_svc->get_meta_storage() and track by meta service tracker.

Copy link
Contributor

@neverchanje neverchanje Jul 10, 2020

Choose a reason for hiding this comment

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

OK. Then I suggest making it a local variable, since as you implied, this variable's only used in this function (initialize_bulk_load_service).

Copy link
Contributor Author

@hycdong hycdong Jul 10, 2020

Choose a reason for hiding this comment

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

It will be used in functions for sync bulk load info, there are five functions, but the tracker will only be used here, because it should be executed synchronously.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I remove _sync_bulk_load_storage in this pull request, I will update it in next pull request.

Comment on lines 309 to 310
mss::meta_storage *get_sync_bulk_load_storage() const { return _sync_bulk_load_storage.get(); }

Copy link
Contributor

Choose a reason for hiding this comment

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

return mss::meta_storage & is a little better

Copy link
Contributor Author

Choose a reason for hiding this comment

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

get_sync_bulk_load_storage is a redundant function, I remove it.

@neverchanje neverchanje merged commit 7055293 into XiaoMi:master Jul 13, 2020
@hycdong hycdong deleted the meta_small_update branch July 13, 2020 02:54
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