fix issuse#41096

This commit is contained in:
young scott 2022-09-14 09:15:40 +00:00
parent d20d49f39f
commit bc111b5680
2 changed files with 9 additions and 4 deletions

View File

@ -61,18 +61,23 @@ public:
return host_fqdn_id;
}
std::string getQueueDir() const
{
return queue_dir;
}
void startup();
virtual void shutdown();
bool isCurrentlyActive() const { return initialized && !stop_flag; }
protected:
/// Returns cached ZooKeeper session (possibly expired).
ZooKeeperPtr tryGetZooKeeper() const;
/// If necessary, creates a new session and caches it.
ZooKeeperPtr getAndSetZooKeeper();
protected:
/// Iterates through queue tasks in ZooKeeper, runs execution of new tasks
void scheduleTasks(bool reinitialized);

View File

@ -205,9 +205,9 @@ static void fillStatusColumns(MutableColumns & res_columns, size_t & col,
void StorageSystemDDLWorkerQueue::fillData(MutableColumns & res_columns, ContextPtr context, const SelectQueryInfo &) const
{
zkutil::ZooKeeperPtr zookeeper = context->getZooKeeper();
fs::path ddl_zookeeper_path = context->getConfigRef().getString("distributed_ddl.path", "/clickhouse/task_queue/ddl/");
auto& ddl_worker = context->getDDLWorker();
fs::path ddl_zookeeper_path = ddl_worker.getQueueDir();
zkutil::ZooKeeperPtr zookeeper = ddl_worker.getAndSetZooKeeper();
Strings ddl_task_paths = zookeeper->getChildren(ddl_zookeeper_path);
GetResponseFutures ddl_task_futures;