Fix error message for a broken distributed batches ("While sending batch")#44907
Merged
serxa merged 1 commit intoClickHouse:masterfrom Feb 7, 2023
Merged
Conversation
Member
Author
|
Closed in favor of #44922 |
azat
added a commit
to azat/ClickHouse
that referenced
this pull request
Jan 5, 2023
In ClickHouse#43406 metrics was broken for a clean start, since they where not initialized from disk, but metrics for broken files was never initialized from disk. Fix this and rework how DirectoryMonitor works with file system: - do not iterate over directory before each send, do this only once on init, after the map of files will be updated from the INSERT - call fs::create_directories() from the ctor for "broken" folder to avoid excessive calls - cache "broken" paths This patch also fixes possible issue when current_batch can be processed multiple times (second time will be an exception), since if there is existing current_batch.txt after processing it you should remove it instantly. Plus this patch implicitly fixes issues with logging, that logs incorrect number of files in case of error (see ClickHouse#44907 for details). Signed-off-by: Azat Khuzhin <[email protected]>
…tch")
There was an error from the begginning that does not respect
file_indices, and iterate only over file_index_to_path, while this is
not correct, since there can be less files then in file_index_to_path,
and this is what file_indices for.
Note, that only an error message was wrong, logic was fine. You can
verify this by the logs:
2022.12.07 11:55:50.951976 [ 39217 ] {} <Debug> default.dist.DirectoryMonitor: Sending a batch of 10 files to localhost:9000 (128.42 thousand rows, 36.32 MiB bytes).
2022.12.07 11:55:50.953762 [ 39217 ] {} <Error> default.dist.DirectoryMonitor: Code: 516. DB::Exception: Received from localhost:9000. DB::Exception: Interserver authentication failed. Stack trace:
...
: While sending batch, nums: 62, files: /work6/clickhouse/data/default/dist/shard1_replica1/66827258.bin
As you can see "Sending a batch of 10 files" but "nums: 62"
Fixes: ClickHouse#23856
Refs: ClickHouse#41813
Signed-off-by: Azat Khuzhin <[email protected]>
80eccb0 to
a196f99
Compare
Member
Author
|
Since #44922 had been reverted, reopening this. |
serxa
approved these changes
Feb 7, 2023
Member
|
All failed tests are unrelated |
1 task
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
There was an error from the begginning that does not respect file_indices, and iterate only over file_index_to_path, while this is not correct, since there can be less files then in file_index_to_path, and this is what file_indices for.
Note, that only an error message was wrong, logic was fine. You can verify this by the logs:
As you can see "Sending a batch of 10 files" but "nums: 62"
Fixes: #23856
Refs: #41813
Changelog category (leave one):