-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[fix] (streamload) fixed the issue of data loss due to concurrency wh… #48948
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
rebuid all |
f23c3c8 to
f9ea572
Compare
|
rebuid all |
| _data_queue.clear(); | ||
| break; | ||
| //1) wait scan operator write data | ||
| if (!_eos && _data_queue.empty() && _writer_status.ok()) { |
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.
| if (!_eos && _data_queue.empty() && _writer_status.ok()) { | |
| { | |
| std::unique_lock l(_m); | |
| while (!_eos && _data_queue.empty() && _writer_status.ok()) { | |
| // Add 1s to check to avoid lost signal | |
| _cv.wait_for(l, std::chrono::seconds(1)); | |
| } | |
| } |
I think we can solve this problem by simply deleting this if condition. The issue of out-of-order execution will be synchronized through the lock later.
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.
The if condition is removed. At the same time, for the rigor and readability of the code, the data is taken from the queue or moved down.
68856cc to
f84f912
Compare
|
rebuid all |
a19d050 to
705d30c
Compare
| if ((_eos && _data_queue.empty()) || !_writer_status.ok()) { | ||
| _data_queue.clear(); | ||
| break; | ||
| //1) wait scan operator write data |
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.
better do the change:
{
std::unique_lock l(_m);
while (!_eos && _data_queue.empty() && _writer_status.ok()) {
// Add 1s to check to avoid lost signal
_cv.wait_for(l, std::chrono::seconds(1));
}
if ((_eos && _data_queue.empty()) || !_writer_status.ok()) {
_data_queue.clear();
break;
}
}
…en importing data from streamload
705d30c to
f1b0bfe
Compare
HappenLee
left a comment
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.
LGTM
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
|
run buildall |
TPC-H: Total hot run time: 32784 ms |
TPC-DS: Total hot run time: 192129 ms |
ClickBench: Total hot run time: 31.38 s |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
liaoxin01
left a comment
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.
LGTM
…en importing data from streamload (apache#48948) This is mainly to solve the multithreading problem caused by inconsistent visible order of EOS and data_queue variables in doris's streamload function and asyn_result_writer in the process_block process due to the compilation reordering of the ARM system or the weak memory order problem, which leads to data loss. Problem Summary: Mainly in the arm architecture, streamload has data loss problems. The transaction of importing data can be executed and submitted normally, but the NumberTotalRowshe NumberFilterRows in the returned load result are both zero [Uploading stream_load_lost_data.docx…]() ((https://github.com/user-attachments/files/19201955/stream_load.docx)) Co-authored-by: lik40 <lik40@chinatelecom.cn>
…en importing data from streamload (apache#48948) This is mainly to solve the multithreading problem caused by inconsistent visible order of EOS and data_queue variables in doris's streamload function and asyn_result_writer in the process_block process due to the compilation reordering of the ARM system or the weak memory order problem, which leads to data loss. Problem Summary: Mainly in the arm architecture, streamload has data loss problems. The transaction of importing data can be executed and submitted normally, but the NumberTotalRowshe NumberFilterRows in the returned load result are both zero [Uploading stream_load_lost_data.docx…]() ((https://github.com/user-attachments/files/19201955/stream_load.docx)) Co-authored-by: lik40 <lik40@chinatelecom.cn>
…en importing data from streamload (apache#48948) (apache#3843) cherry-pick from: apache#48948 http://jira.selectdb-in.cc/browse/CIR-14580
…en importing data from streamload (apache#48948) ### What problem does this PR solve? This is mainly to solve the multithreading problem caused by inconsistent visible order of EOS and data_queue variables in doris's streamload function and asyn_result_writer in the process_block process due to the compilation reordering of the ARM system or the weak memory order problem, which leads to data loss. Problem Summary: Mainly in the arm architecture, streamload has data loss problems. The transaction of importing data can be executed and submitted normally, but the NumberTotalRowshe NumberFilterRows in the returned load result are both zero [Uploading stream_load_lost_data.docx…]() ((https://github.com/user-attachments/files/19201955/stream_load.docx)) Co-authored-by: lik40 <lik40@chinatelecom.cn>
…en importing data from streamload
What problem does this PR solve?
This is mainly to solve the multithreading problem caused by inconsistent visible order of EOS and data_queue variables in doris's streamload function and asyn_result_writer in the process_block process due to the compilation reordering of the ARM system or the weak memory order problem, which leads to data loss.
Problem Summary:
Mainly in the arm architecture, streamload has data loss problems. The transaction of importing data can be executed and submitted normally, but the NumberTotalRowshe NumberFilterRows in the returned load result are both zero
Uploading stream_load_lost_data.docx…
((https://github.com/user-attachments/files/19201955/stream_load.docx))