mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-12-17 11:52:27 +00:00
ec7d367814
Add DiskLocal checker so that ReplicatedMergeTree can recover data when some of its disks are broken.
40 lines
616 B
C++
40 lines
616 B
C++
#pragma once
|
|
|
|
#include <Core/BackgroundSchedulePool.h>
|
|
#include <Interpreters/Context_fwd.h>
|
|
|
|
namespace Poco
|
|
{
|
|
class Logger;
|
|
}
|
|
|
|
namespace DB
|
|
{
|
|
class DiskLocal;
|
|
|
|
class DiskLocalCheckThread : WithContext
|
|
{
|
|
public:
|
|
friend class DiskLocal;
|
|
|
|
DiskLocalCheckThread(DiskLocal * disk_, ContextPtr context_, UInt64 local_disk_check_period_ms);
|
|
|
|
void startup();
|
|
|
|
void shutdown();
|
|
|
|
private:
|
|
bool check();
|
|
void run();
|
|
|
|
DiskLocal * disk;
|
|
size_t check_period_ms;
|
|
Poco::Logger * log;
|
|
std::atomic<bool> need_stop{false};
|
|
|
|
BackgroundSchedulePool::TaskHolder task;
|
|
size_t retry{};
|
|
};
|
|
|
|
}
|