mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Fix mutaion status for retryable errors
This commit is contained in:
parent
06499ce847
commit
1582c4bf24
@ -31,6 +31,7 @@ bool ReplicatedMergeMutateTaskBase::executeStep()
|
||||
{
|
||||
std::exception_ptr saved_exception;
|
||||
|
||||
bool retryable_error = false;
|
||||
try
|
||||
{
|
||||
/// We don't have any backoff for failed entries
|
||||
@ -46,16 +47,19 @@ bool ReplicatedMergeMutateTaskBase::executeStep()
|
||||
{
|
||||
/// If no one has the right part, probably not all replicas work; We will not write to log with Error level.
|
||||
LOG_INFO(log, fmt::runtime(e.displayText()));
|
||||
retryable_error = true;
|
||||
}
|
||||
else if (e.code() == ErrorCodes::ABORTED)
|
||||
{
|
||||
/// Interrupted merge or downloading a part is not an error.
|
||||
LOG_INFO(log, fmt::runtime(e.message()));
|
||||
retryable_error = true;
|
||||
}
|
||||
else if (e.code() == ErrorCodes::PART_IS_TEMPORARILY_LOCKED)
|
||||
{
|
||||
/// Part cannot be added temporarily
|
||||
LOG_INFO(log, fmt::runtime(e.displayText()));
|
||||
retryable_error = true;
|
||||
storage.cleanup_thread.wakeup();
|
||||
}
|
||||
else
|
||||
@ -80,7 +84,7 @@ bool ReplicatedMergeMutateTaskBase::executeStep()
|
||||
}
|
||||
|
||||
|
||||
if (saved_exception)
|
||||
if (!retryable_error && saved_exception)
|
||||
{
|
||||
std::lock_guard lock(storage.queue.state_mutex);
|
||||
|
||||
|
@ -1668,6 +1668,7 @@ bool ReplicatedMergeTreeQueue::tryFinalizeMutations(zkutil::ZooKeeperPtr zookeep
|
||||
{
|
||||
LOG_TRACE(log, "Marking mutation {} done because it is <= mutation_pointer ({})", znode, mutation_pointer);
|
||||
mutation.is_done = true;
|
||||
mutation.latest_fail_reason.clear();
|
||||
alter_sequence.finishDataAlter(mutation.entry->alter_version, lock);
|
||||
if (mutation.parts_to_do.size() != 0)
|
||||
{
|
||||
@ -1712,6 +1713,7 @@ bool ReplicatedMergeTreeQueue::tryFinalizeMutations(zkutil::ZooKeeperPtr zookeep
|
||||
{
|
||||
LOG_TRACE(log, "Mutation {} is done", entry->znode_name);
|
||||
it->second.is_done = true;
|
||||
it->second.latest_fail_reason.clear();
|
||||
if (entry->isAlterMutation())
|
||||
{
|
||||
LOG_TRACE(log, "Finishing data alter with version {} for entry {}", entry->alter_version, entry->znode_name);
|
||||
|
@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# Tags: zookeeper, no-parallel
|
||||
# Tags: zookeeper, no-parallel, no-s3-storage
|
||||
|
||||
# Because REPLACE PARTITION does not forces immediate removal of replaced data parts from local filesystem
|
||||
# (it tries to do it as quick as possible, but it still performed in separate thread asynchronously)
|
||||
|
@ -1,3 +1,5 @@
|
||||
-- Tags: no-s3-storage
|
||||
|
||||
DROP TABLE IF EXISTS data_01551;
|
||||
|
||||
CREATE TABLE data_01551
|
||||
|
Loading…
Reference in New Issue
Block a user