mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-23 16:12:01 +00:00
Fixed deadlock in test when many replicas on single server try to execute multiple attaches and wait for each other [#METR-23507].
This commit is contained in:
parent
00fc6f5616
commit
866e64a65e
@ -1207,13 +1207,9 @@ bool StorageReplicatedMergeTree::executeLogEntry(const LogEntry & entry)
|
||||
}
|
||||
|
||||
if (do_fetch)
|
||||
{
|
||||
String replica;
|
||||
|
||||
try
|
||||
{
|
||||
String covering_part;
|
||||
replica = findReplicaHavingCoveringPart(entry.new_part_name, true, covering_part);
|
||||
String replica = findReplicaHavingCoveringPart(entry.new_part_name, true, covering_part);
|
||||
|
||||
if (replica.empty() && entry.type == LogEntry::ATTACH_PART)
|
||||
{
|
||||
@ -1226,11 +1222,11 @@ bool StorageReplicatedMergeTree::executeLogEntry(const LogEntry & entry)
|
||||
throw Exception("Logical error: no source replica specified for ATTACH_PART log entry;"
|
||||
" or trying to fetch part on source replica", ErrorCodes::LOGICAL_ERROR);
|
||||
|
||||
/// Подождём, пока реплика-инициатор подцепит кусок.
|
||||
waitForReplicaToProcessLogEntry(entry.source_replica, entry);
|
||||
replica = findReplicaHavingCoveringPart(entry.new_part_name, true, covering_part);
|
||||
throw Exception("No active replica has attached part " + entry.new_part_name + " or covering part yet", ErrorCodes::NO_REPLICA_HAS_PART);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
if (replica.empty())
|
||||
{
|
||||
/** Если кусок должен быть записан с кворумом, и кворум ещё недостигнут,
|
||||
|
Loading…
Reference in New Issue
Block a user