Skip to content

Fix stuck while processing pending batch for async distributed INSERT - #72939

Merged
azat merged 2 commits into
ClickHouse:masterfrom
azat:dist-fix-batch-on-startup
Mar 8, 2025
Merged

azat merged 2 commits into
ClickHouse:masterfrom
azat:dist-fix-batch-on-startup

Conversation

@azat

@azat azat commented Dec 9, 2024

Copy link
Copy Markdown
Member

Changelog category (leave one):

  • Bug Fix (user-visible misbehavior in an official stable release)

Changelog entry (a user-readable short description of the changes that goes to CHANGELOG.md):

Fix stuck while processing pending batch for async distributed INSERT (due to i.e. No such file or directory)

In #57480 I've fixed exactly the same problem (stuck due to non-existing file), but in #66375 I broke it since before checking valid() the code now tries to read files and got "No such file or directory" exception.

Rewrite the code to reduce the complexity by:

  • removing extra helpers
  • remove some object flags (recovered) and use function arguments instead

It also fixes one typo for accounting total_bytes in case of recovery.

@robot-clickhouse-ci-1 robot-clickhouse-ci-1 added the pr-bugfix Pull request with bugfix, not backported by default label Dec 9, 2024
@robot-ch-test-poll2

robot-ch-test-poll2 commented Dec 9, 2024 •

Copy link
Copy Markdown
Contributor

This is an automated comment for commit e64c790 with description of existing statuses. It's updated for the latest CI running

❌ Click here to open a full report in a separate page

Check nameDescriptionStatus
Integration testsThe integration tests report. In parenthesis the package type is given, and in square brackets are the optional part/total tests❌ failure
Successful checks
Check nameDescriptionStatus
BuildsThere's no description for the check yet, please add it to tests/ci/ci_config.py:CHECK_DESCRIPTIONS✅ success
Docs checkBuilds and tests the documentation✅ success
Fast testNormally this is the first check that is ran for a PR. It builds ClickHouse and runs most of stateless functional tests, omitting some. If it fails, further checks are not started until it is fixed. Look at the report to see which tests fail, then reproduce the failure locally as described here✅ success
Flaky testsChecks if new added or modified tests are flaky by running them repeatedly, in parallel, with more randomization. Functional tests are run 100 times with address sanitizer, and additional randomization of thread scheduling. Integration tests are run up to 10 times. If at least once a new test has failed, or was too long, this check will be red. We don't allow flaky tests, read the doc✅ success
Stateful testsRuns stateful functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Stateless testsRuns stateless functional tests for ClickHouse binaries built in various configurations -- release, debug, with sanitizers, etc✅ success
Style checkRuns a set of checks to keep the code style clean. If some of tests failed, see the related log from the report✅ success
Unit testsRuns the unit tests for different release types✅ success

@azat

azat commented Dec 28, 2024 •

Copy link
Copy Markdown
Member Author

Can someone please take a look (conflicts has been fixed)

In ClickHouse#57480 I've fixed exactly the same problem (stuck due to non-existing
file), but in ClickHouse#66375 I broke it since before checking valid() the code
now tries to read files and got "No such file or directory" exception.

Rewrite the code to reduce the complexity by:
- removing extra helpers
- remove some object flags (recovered) and use function arguments
  instead

It also fixes one typo for accounting total_bytes in case of recovery.

Signed-off-by: Azat Khuzhin <[email protected]>
@azat
azat force-pushed the dist-fix-batch-on-startup branch from 81b1a85 to e64c790 Compare December 28, 2024 20:11
@azat

azat commented Dec 30, 2024 •

Copy link
Copy Markdown
Member Author

@yariks5s yariks5s self-assigned this Mar 7, 2025
@azat

azat commented Mar 7, 2025 •

Copy link
Copy Markdown
Member Author

OK, @yariks5s thanks for taking a look, let me merge with master now

@clickhouse-gh

clickhouse-gh Bot commented Mar 7, 2025

Copy link
Copy Markdown
Contributor

Workflow [PR], commit [04b8b52]

@azat
azat added this pull request to the merge queue Mar 8, 2025
@azat

azat commented Mar 8, 2025

Copy link
Copy Markdown
Member Author

CI:

Bugfix validation — New test(s) failed to reproduce a bug

It is a bug fix, but it is hard to provide a test

Stateless tests (azure, asan, 2/3) — fail: 2, passed: 2513, skipped: 64

Stateless tests (azure, asan, 3/3) — Server died, fail: 11, passed: 1001, skipped: 25

Merged via the queue into ClickHouse:master with commit aec7501 Mar 8, 2025
@azat
azat deleted the dist-fix-batch-on-startup branch March 8, 2025 08:47
@robot-ch-test-poll1 robot-ch-test-poll1 added the pr-synced-to-cloud The PR is synced to the cloud repo label Mar 8, 2025
@clickgapai

Copy link
Copy Markdown
Contributor

Hi @azat @yariks5s — while reviewing this PR I found the following:

Happy to discuss — close anything that's wrong or already addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-bugfix Pull request with bugfix, not backported by default pr-synced-to-cloud The PR is synced to the cloud repo

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants