Merge pull request #24809 from ClickHouse/fix_kill_mutation_wait

Fix mutation wait on mutation kill
This commit is contained in:
alesapin 2021-06-01 10:37:24 +03:00 committed by GitHub
commit b7c4f7dff8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -526,10 +526,11 @@ void StorageReplicatedMergeTree::waitMutationToFinishOnReplicas(
if (wait_event->tryWait(1000))
continue;
/// Here we check mutation for errors or kill on local replica. If they happen on this replica
/// Here we check mutation for errors on local replica. If they happen on this replica
/// they will happen on each replica, so we can check only in-memory info.
auto mutation_status = queue.getIncompleteMutationsStatus(mutation_id);
if (!mutation_status || !mutation_status->latest_fail_reason.empty())
/// If mutation status is empty, than local replica may just not loaded it into memory.
if (mutation_status && !mutation_status->latest_fail_reason.empty())
break;
}