Skip to content

Conversation

@ianton-ru
Copy link

@ianton-ru ianton-ru commented Nov 28, 2025

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 for task distribution in cluster requests.

Documentation entry for user-facing changes

When lock_object_storage_task_distribution_ms setting is greater than 0, replica, which processed all tasks can get some unprocessed task, when "replica-task owner" does not ask for a new task for this time.
But on start of query if one replica has a few tasks (less than max_threads), it can ask for unprocessed task before other replica ask for first task. In this case task goes to the "wrong" replica even when "correct" is ready to process it.

This fix add time of query start as initial time for replicas activity. This allow to send unprocessed tasks to random replicas only lock_object_storage_task_distribution_ms after query start.

Second fix - sending JSON with waiting time was broken during rebase, as result replica gets empty string what means "no more tasks to process"

Third fix - selection from unprocessed_files does not see on priority replica, as result tasks from unprocessed_files goes to random replica.

CI/CD Options

Exclude tests:

  • Fast test
  • Integration Tests
  • Stateless tests
  • Stateful tests
  • Performance tests
  • All with ASAN
  • All with TSAN
  • All with MSAN
  • All with UBSAN
  • All with Coverage
  • All with Aarch64
  • All Regression
  • Disable CI Cache

Regression jobs to run:

  • Fast suites (mostly <1h)
  • Aggregate Functions (2h)
  • Alter (1.5h)
  • Benchmark (30m)
  • ClickHouse Keeper (1h)
  • Iceberg (2h)
  • LDAP (1h)
  • Parquet (1.5h)
  • RBAC (1.5h)
  • SSL Server (1h)
  • S3 (2h)
  • Tiered Storage (2h)

@github-actions
Copy link

github-actions bot commented Nov 28, 2025

Workflow [PR], commit [cb8916c0]

@mkmkme
Copy link
Collaborator

mkmkme commented Dec 3, 2025

@codex review

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. 👍

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@ianton-ru
Copy link
Author

@codex review

@chatgpt-codex-connector
Copy link

To use Codex here, create a Codex account and connect to github.

@mkmkme
Copy link
Collaborator

mkmkme commented Dec 3, 2025

@codex review

Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 226 to 235
log,
"Iterator exhausted. Assigning unprocessed file {} to replica {}",
"Iterator exhausted. Assigning unprocessed file {} to replica {}, original matching replica {}",
file_path,
number_of_current_replica
number_of_current_replica,
it->second.second

Choose a reason for hiding this comment

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

P1 Badge Avoid dereferencing iterator after erase

In getAnyUnprocessedFile the iterator it is erased from unprocessed_files earlier in this block (line 227), but the log message still reads it->second.second afterwards. Erasing an iterator from an unordered_map invalidates it, so dereferencing it for logging is undefined behaviour and can lead to crashes or garbage output whenever this branch runs. Capture the original replica id before erasing the entry and log that instead.

Useful? React with 👍 / 👎.

@mkmkme
Copy link
Collaborator

mkmkme commented Dec 3, 2025

@codex review


# New node and old node, different nodes order
# New replica and old replica, different replicas order
# All files form removed replica changed replica
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nitpick: form -> from here and the line below

@chatgpt-codex-connector
Copy link

Codex Review: Didn't find any major issues. You're on a roll.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

mkmkme
mkmkme previously approved these changes Dec 3, 2025
@Enmk Enmk merged commit 79ff374 into antalya-25.8 Dec 4, 2025
107 of 112 checks passed
@alsugiliazova alsugiliazova added the verified Verified by QA label Jan 6, 2026
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.

6 participants