-
Notifications
You must be signed in to change notification settings - Fork 58
feat(bulk-load): bulk load ingestion part5 - replica handle bulk load request during ingestion #496
Conversation
} | ||
|
||
// ThreadPool: THREAD_POOL_REPLICATION | ||
void replica_bulk_loader::check_ingestion_finish() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I understood the method is check whether the ingetion is finished
, but the logic seem mean gurantee it can be finished
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, it is depends on when ingestion is finished, in my view, this function means check whether primary replica's ingestion_status is ingestion_succeed, besides, if it has not sent empty prepare to secondaries, sends empty prepare to make secondaries commit this mutation, I think it is to guarantee data integrity. Actually, when primary sends empty prepare to secondaries, ingestion is not finished. All replicas' ingestion_status are ingestion_succeed means ingestion finished.
…k load request during ingestion XiaoMi#496
The whole bulk load ingestion process is like:
This pull request is about how replica handle bulk_load_request during ingestion.
do_bulk_load
bulk_load_request
and secondary receivesgroup_bulk_load_request
. It will first check primary status, and compare bulk load status from request and replica local bulk load status (in functionvalidate_bulk_load_status
, not implemented in this pull request), then call different functions according to bulk load status.start_download
to start download files from file provider.start_ingestion
check_ingestion_finish
ingestion_is_empty_prepare_sent
in primary_context to write empty put only once.pop_all_committed_mutations
parameter for functioninit_prepare
,send_prepare_message
,prepare
, addpop_all
for thrift structurereplica_configuration
.report_bulk_load_states_to_primary
report_group_ingestion_status
, when group ingestion succeed, recover normal write