mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 00:22:29 +00:00
Merge pull request #47770 from ClickHouse/stop_wait_for_quorum_retries_on_shutdown
Stop `wait for quorum` retries on shutdown
This commit is contained in:
commit
c2c7895b82
@ -1073,13 +1073,26 @@ std::vector<String> ReplicatedMergeTreeSinkImpl<async_insert>::commitPart(
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
[&zookeeper]() { zookeeper->cleanupEphemeralNodes(); });
|
[&zookeeper]() { zookeeper->cleanupEphemeralNodes(); });
|
||||||
|
|
||||||
if (!conflict_block_ids.empty())
|
if (!conflict_block_ids.empty())
|
||||||
return conflict_block_ids;
|
return conflict_block_ids;
|
||||||
|
|
||||||
if (isQuorumEnabled())
|
if (isQuorumEnabled())
|
||||||
{
|
{
|
||||||
ZooKeeperRetriesControl quorum_retries_ctl("waitForQuorum", zookeeper_retries_info);
|
ZooKeeperRetriesControl quorum_retries_ctl("waitForQuorum", zookeeper_retries_info);
|
||||||
quorum_retries_ctl.retryLoop([&]()
|
quorum_retries_ctl.retryLoop([&]()
|
||||||
{
|
{
|
||||||
|
if (storage.is_readonly)
|
||||||
|
{
|
||||||
|
/// stop retries if in shutdown
|
||||||
|
if (storage.shutdown_called)
|
||||||
|
throw Exception(
|
||||||
|
ErrorCodes::TABLE_IS_READ_ONLY, "Table is in readonly mode due to shutdown: replica_path={}", storage.replica_path);
|
||||||
|
|
||||||
|
quorum_retries_ctl.setUserError(ErrorCodes::TABLE_IS_READ_ONLY, "Table is in readonly mode: replica_path={}", storage.replica_path);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
zookeeper->setKeeper(storage.getZooKeeper());
|
zookeeper->setKeeper(storage.getZooKeeper());
|
||||||
|
|
||||||
if (is_already_existing_part)
|
if (is_already_existing_part)
|
||||||
|
Loading…
Reference in New Issue
Block a user