mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-20 00:30:49 +00:00
fix 01158_zookeeper_log_long and 02442_auxiliary_zookeeper_endpoint
This commit is contained in:
parent
82270627ed
commit
a1c9501c07
@ -707,7 +707,22 @@ void StorageReplicatedMergeTree::createNewZooKeeperNodes()
|
||||
const auto table_shared_id_ = getTableSharedID();
|
||||
|
||||
if (!disk_types_for_zero_copy.empty())
|
||||
futures.push_back(zookeeper->asyncTryCreateNoThrow(settings->remote_fs_zero_copy_zookeeper_path.toString(), String(), zkutil::CreateMode::Persistent));
|
||||
{
|
||||
/// create all ancestors of remote_fs_zero_copy_zookeeper_path
|
||||
auto remote_fs_zero_copy_zookeeper_path = fs::path(settings->remote_fs_zero_copy_zookeeper_path.toString());
|
||||
fs::path ancestor = *remote_fs_zero_copy_zookeeper_path.begin();
|
||||
for (auto it = ++remote_fs_zero_copy_zookeeper_path.begin(); it != remote_fs_zero_copy_zookeeper_path.end(); it++)
|
||||
{
|
||||
/// If there is a directory separator after the last file-name in the path,
|
||||
/// the last element before the end iterator is an empty element.
|
||||
/// We do not what to create path with the / at the end
|
||||
if (!it->empty())
|
||||
{
|
||||
ancestor = ancestor / *it;
|
||||
futures.push_back(zookeeper->asyncTryCreateNoThrow(ancestor, String(), zkutil::CreateMode::Persistent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (const auto & disk_type: disk_types_for_zero_copy)
|
||||
{
|
||||
@ -747,7 +762,7 @@ void StorageReplicatedMergeTree::createNewZooKeeperNodes()
|
||||
{
|
||||
auto res = future.get();
|
||||
if (res.error != Coordination::Error::ZOK && res.error != Coordination::Error::ZNODEEXISTS)
|
||||
throw Coordination::Exception(res.error, "Failed to create new nodes at {}", zookeeper_path);
|
||||
throw Coordination::Exception(res.error, "Failed to create new nodes {} at {}", res.path_created, zookeeper_path);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,13 @@ SET insert_keeper_fault_injection_probability=0; -- disable fault injection; par
|
||||
drop table if exists rmt sync;
|
||||
-- cleanup code will perform extra Exists
|
||||
-- (so the .reference will not match)
|
||||
create table rmt (n int) engine=ReplicatedMergeTree('/test/01158/{database}/rmt', '1') order by n settings cleanup_delay_period=86400, max_cleanup_delay_period=86400, replicated_can_become_leader=0;
|
||||
create table rmt (n int) engine=ReplicatedMergeTree('/test/01158/{database}/rmt', '1')
|
||||
order by n
|
||||
settings
|
||||
cleanup_delay_period=86400,
|
||||
max_cleanup_delay_period=86400,
|
||||
replicated_can_become_leader=0,
|
||||
allow_remote_fs_zero_copy_replication=0;
|
||||
system sync replica rmt;
|
||||
insert into rmt values (1);
|
||||
insert into rmt values (1);
|
||||
|
Loading…
Reference in New Issue
Block a user