Uh oh!
There was an error while loading. Please reload this page.
[fix] (streamload) fixed the issue of data loss due to concurrency wh… - #48948
Conversation
Thearas
commented
Mar 12, 2025
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
ghkang98
commented
Mar 12, 2025
rebuid all |
f23c3c8 to
f9ea572Compareghkang98
commented
Mar 12, 2025
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.
| 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.
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
f84f912Compareghkang98
commented
Mar 12, 2025
rebuid all |
a19d050 to
705d30cCompare| 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.
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
f1b0bfeComparePR approved by at least one committer and no changes requested. |
PR approved by anyone and no changes requested. |
HappenLee
commented
Mar 15, 2025
run buildall |
doris-robot
commented
Mar 15, 2025
TPC-H: Total hot run time: 32784 ms |
doris-robot
commented
Mar 15, 2025
TPC-DS: Total hot run time: 192129 ms |
doris-robot
commented
Mar 15, 2025
ClickBench: Total hot run time: 31.38 s |
hello-stephen
commented
Mar 15, 2025
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
…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#48948http://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))