Skip to content
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

[BugFix] Fix the problem of SinkIOBuffer getting stuck #40874

Merged
merged 6 commits into from
Feb 7, 2024

Conversation

trueeyu
Copy link
Contributor

@trueeyu trueeyu commented Feb 6, 2024

Why I'm doing:

If _cancelled is true and io queue is executing the last data chunk, the _pending_num_tasks maybe 0/1/2. So the subsequent sentinel requests cannot be executed either.

0: The io task is already pushed to queue and run, but _pending_num_tasks is not +1 now.
2: The sentinel request is pushed back to queue, and ++_pending_num_tasks.

What I'm doing:

  • Extract public code and put it into SinkIOBuffer
  • Add a SinkIOBuffer test framework
  • Move sentinel request before cancel check.
  • Rmove the dcheck of _pending_num_tasks.

What type of PR is this:

  • BugFix
  • Feature
  • Enhancement
  • Refactor
  • UT
  • Doc
  • Tool

Does this PR entail a change in behavior?

  • Yes, this PR will result in a change in behavior.
  • No, this PR will not result in a change in behavior.

If yes, please specify the type of change:

  • Interface/UI changes: syntax, type conversion, expression evaluation, display information
  • Parameter changes: default values, similar parameters but with different default values
  • Policy changes: use new policy to replace old one, functionality automatically enabled
  • Feature removed
  • Miscellaneous: upgrade & downgrade compatibility, etc.

Checklist:

  • I have added test cases for my bug fix or my new feature
  • This pr needs user documentation (for new or modified features or behaviors)
    • I have added documentation for my new feature or new function
  • This is a backport pr

Bugfix cherry-pick branch check:

  • I have checked the version labels which the pr will be auto-backported to the target branch
    • 3.2
    • 3.1
    • 3.0
    • 2.5

Signed-off-by: trueeyu <lxhhust350@qq.com>
@trueeyu trueeyu requested a review from a team as a code owner February 6, 2024 06:30
@mergify mergify bot assigned trueeyu Feb 6, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
Signed-off-by: trueeyu <lxhhust350@qq.com>
@github-actions github-actions bot added the 3.1 label Feb 6, 2024
return;
}

if (_is_cancelled && !_is_finished) {
Copy link
Contributor

Choose a reason for hiding this comment

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

when arrive this line _is_finished is always true. it seems check !_is_finished is unnecessary

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 also think it's unnecessary, but I don't understand his deep meaning here, and I'm afraid that there will be other problems if I change it, later caixiaohua will completely reconstruct it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

kevincai
kevincai previously approved these changes Feb 6, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
@trueeyu trueeyu changed the title [BugFix] Fix the problem of SinkIOBuffer getting stuck [WIP] [BugFix] Fix the problem of SinkIOBuffer getting stuck Feb 6, 2024
Signed-off-by: trueeyu <lxhhust350@qq.com>
@trueeyu trueeyu changed the title [WIP] [BugFix] Fix the problem of SinkIOBuffer getting stuck [BugFix] Fix the problem of SinkIOBuffer getting stuck Feb 6, 2024
Copy link

github-actions bot commented Feb 6, 2024

[FE Incremental Coverage Report]

pass : 0 / 0 (0%)

Copy link

github-actions bot commented Feb 6, 2024

[BE Incremental Coverage Report]

pass : 16 / 19 (84.21%)

file detail

path covered_line new_line coverage not_covered_line_detail
🔵 be/src/exec/pipeline/sink/export_sink_operator.cpp 0 1 00.00% [86]
🔵 be/src/exec/pipeline/sink/mysql_table_sink_operator.cpp 0 1 00.00% [81]
🔵 be/src/exec/pipeline/sink/sink_io_buffer.h 3 4 75.00% [91]
🔵 be/src/exec/pipeline/sink/file_sink_operator.cpp 1 1 100.00% []
🔵 be/src/exec/pipeline/sink/sink_io_buffer.cpp 12 12 100.00% []

@imay imay merged commit 50987d3 into StarRocks:main Feb 7, 2024
62 of 65 checks passed
Copy link

github-actions bot commented Feb 7, 2024

@Mergifyio backport branch-3.2

Copy link

github-actions bot commented Feb 7, 2024

@Mergifyio backport branch-3.1

Copy link

github-actions bot commented Feb 7, 2024

@Mergifyio backport branch-3.0

@github-actions github-actions bot removed the 3.0 label Feb 7, 2024
Copy link

github-actions bot commented Feb 7, 2024

@Mergifyio backport branch-2.5

@github-actions github-actions bot removed the 2.5 label Feb 7, 2024
Copy link
Contributor

mergify bot commented Feb 7, 2024

backport branch-3.2

✅ Backports have been created

Copy link
Contributor

mergify bot commented Feb 7, 2024

backport branch-3.1

✅ Backports have been created

Copy link
Contributor

mergify bot commented Feb 7, 2024

backport branch-3.0

✅ Backports have been created

Copy link
Contributor

mergify bot commented Feb 7, 2024

backport branch-2.5

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Feb 7, 2024
Why I'm doing:
If _cancelled is true and io queue is executing the last data chunk, the _pending_num_tasks maybe 0/1/2. So the subsequent sentinel requests cannot be executed either.

0: The io task is already pushed to queue and run, but _pending_num_tasks is not +1 now.
2: The sentinel request is pushed back to queue, and ++_pending_num_tasks.

What I'm doing:
Extract public code and put it into SinkIOBuffer
Add a SinkIOBuffer test framework
Move sentinel request before cancel check.
Rmove the dcheck of _pending_num_tasks.

Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 50987d3)

# Conflicts:
#	be/src/exec/pipeline/sink/export_sink_operator.cpp
#	be/src/exec/pipeline/sink/file_sink_operator.cpp
#	be/src/exec/pipeline/sink/mysql_table_sink_operator.cpp
#	be/test/exec/sink/sink_io_buffer_test.cpp
mergify bot pushed a commit that referenced this pull request Feb 7, 2024
Why I'm doing:
If _cancelled is true and io queue is executing the last data chunk, the _pending_num_tasks maybe 0/1/2. So the subsequent sentinel requests cannot be executed either.

0: The io task is already pushed to queue and run, but _pending_num_tasks is not +1 now.
2: The sentinel request is pushed back to queue, and ++_pending_num_tasks.

What I'm doing:
Extract public code and put it into SinkIOBuffer
Add a SinkIOBuffer test framework
Move sentinel request before cancel check.
Rmove the dcheck of _pending_num_tasks.

Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 50987d3)

# Conflicts:
#	be/src/exec/CMakeLists.txt
mergify bot pushed a commit that referenced this pull request Feb 7, 2024
Why I'm doing:
If _cancelled is true and io queue is executing the last data chunk, the _pending_num_tasks maybe 0/1/2. So the subsequent sentinel requests cannot be executed either.

0: The io task is already pushed to queue and run, but _pending_num_tasks is not +1 now.
2: The sentinel request is pushed back to queue, and ++_pending_num_tasks.

What I'm doing:
Extract public code and put it into SinkIOBuffer
Add a SinkIOBuffer test framework
Move sentinel request before cancel check.
Rmove the dcheck of _pending_num_tasks.

Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 50987d3)

# Conflicts:
#	be/src/exec/CMakeLists.txt
#	be/src/exec/pipeline/sink/export_sink_operator.cpp
#	be/src/exec/pipeline/sink/file_sink_operator.cpp
#	be/src/exec/pipeline/sink/mysql_table_sink_operator.cpp
mergify bot pushed a commit that referenced this pull request Feb 7, 2024
Why I'm doing:
If _cancelled is true and io queue is executing the last data chunk, the _pending_num_tasks maybe 0/1/2. So the subsequent sentinel requests cannot be executed either.

0: The io task is already pushed to queue and run, but _pending_num_tasks is not +1 now.
2: The sentinel request is pushed back to queue, and ++_pending_num_tasks.

What I'm doing:
Extract public code and put it into SinkIOBuffer
Add a SinkIOBuffer test framework
Move sentinel request before cancel check.
Rmove the dcheck of _pending_num_tasks.

Signed-off-by: trueeyu <lxhhust350@qq.com>
(cherry picked from commit 50987d3)

# Conflicts:
#	be/src/exec/CMakeLists.txt
#	be/src/exec/pipeline/sink/export_sink_operator.cpp
#	be/src/exec/pipeline/sink/file_sink_operator.cpp
#	be/src/exec/pipeline/sink/mysql_table_sink_operator.cpp
wanpengfei-git pushed a commit that referenced this pull request Feb 7, 2024
…) (#40927)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Feb 7, 2024
…) (#40928)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Feb 15, 2024
…) (#40929)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
wanpengfei-git pushed a commit that referenced this pull request Feb 16, 2024
…) (#40926)

Signed-off-by: trueeyu <lxhhust350@qq.com>
Co-authored-by: trueeyu <lxhhust350@qq.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants