-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Do not write retriable errors for Replicated mutate/merge into error log #55944
Merged
tavplubix
merged 5 commits into
ClickHouse:master
from
azat:rmt-retriable-exception-log
Oct 25, 2023
Merged
Changes from 2 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
38a4547
Do not write retriable errors for Replicated mutate/merge into error log
azat bd26f70
Add a test for retrible errors (i.e. "No active replica has part {} o…
azat 40a0190
Convert 02903_rmt_retriable_merge_exception to an sh test with proper…
azat da408df
Proper ignoring of retriable errors during merge/mutate
azat 66c4a3b
tests: more robust 02903_rmt_retriable_merge_exception
azat File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains 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
1 change: 1 addition & 0 deletions
1
tests/queries/0_stateless/02903_rmt_retriable_merge_exception.reference
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Information 1 |
32 changes: 32 additions & 0 deletions
32
tests/queries/0_stateless/02903_rmt_retriable_merge_exception.sql
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- Test that retriable errors during merges/mutations | ||
-- (i.e. "No active replica has part X or covering part") | ||
-- does not appears as errors (level=Error), only as info message (level=Information). | ||
|
||
drop table if exists rmt1; | ||
drop table if exists rmt2; | ||
|
||
create table rmt1 (key Int) engine=ReplicatedMergeTree('/clickhouse/{database}', '1') order by key settings always_fetch_merged_part=1; | ||
create table rmt2 (key Int) engine=ReplicatedMergeTree('/clickhouse/{database}', '2') order by key settings always_fetch_merged_part=0; | ||
|
||
insert into rmt1 values (1); | ||
insert into rmt1 values (2); | ||
|
||
system stop pulling replication log rmt2; | ||
optimize table rmt1 final settings alter_sync=0; | ||
|
||
select sleep(3) format Null; | ||
system start pulling replication log rmt2; | ||
|
||
system flush logs; | ||
with | ||
(select uuid from system.tables where database = currentDatabase() and table = 'rmt1') as uuid_ | ||
select | ||
level, count() > 0 | ||
from system.text_log | ||
where | ||
event_date >= yesterday() and event_time >= now() - 60 and | ||
( | ||
(logger_name = 'MergeTreeBackgroundExecutor' and message like '%{' || uuid_::String || '::all_0_1_1}%No active replica has part all_0_1_1 or covering part%') or | ||
(logger_name = uuid_::String || '::all_0_1_1 (MergeFromLogEntryTask)' and message like '%No active replica has part all_0_1_1 or covering part%') | ||
) | ||
group by level; |
Oops, something went wrong.
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 a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately, it will not work because we have some logic built on top of exceptions... (so we have to rethow it unconditionally, otherwise replication queue may get stuck, as you can see in the failed tests)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Btw, I was thinking that maybe we have some backoff on retries of failed queue entries, it would help too
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, now I see, though it is not about replication queue, but about abort in the WriteBuffer dtor, but maybe there are more problems?
Anyway, I rewrote the patch, introduced
IExecutableTask::printExecutionException()
to let theMergeTreeBackgroundExecutor
decide. Looks a little bit hackish I too much, maybe, but what do you think?