mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-27 01:51:59 +00:00
Parallel replicas: simple cleanup
This commit is contained in:
parent
92bb69e062
commit
033155d8fa
@ -2,7 +2,6 @@
|
||||
|
||||
#include <cstddef>
|
||||
#include <deque>
|
||||
#include <set>
|
||||
|
||||
#include <fmt/core.h>
|
||||
#include <fmt/format.h>
|
||||
|
@ -981,10 +981,7 @@ void ParallelReplicasReadingCoordinator::handleInitialAllRangesAnnouncement(Init
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
if (!pimpl)
|
||||
{
|
||||
mode = announcement.mode;
|
||||
initialize();
|
||||
}
|
||||
initialize(announcement.mode);
|
||||
|
||||
return pimpl->handleInitialAllRangesAnnouncement(std::move(announcement));
|
||||
}
|
||||
@ -996,10 +993,7 @@ ParallelReadResponse ParallelReplicasReadingCoordinator::handleRequest(ParallelR
|
||||
std::lock_guard lock(mutex);
|
||||
|
||||
if (!pimpl)
|
||||
{
|
||||
mode = request.mode;
|
||||
initialize();
|
||||
}
|
||||
initialize(request.mode);
|
||||
|
||||
const auto replica_num = request.replica_num;
|
||||
auto response = pimpl->handleRequest(std::move(request));
|
||||
@ -1024,7 +1018,7 @@ void ParallelReplicasReadingCoordinator::markReplicaAsUnavailable(size_t replica
|
||||
pimpl->markReplicaAsUnavailable(replica_number);
|
||||
}
|
||||
|
||||
void ParallelReplicasReadingCoordinator::initialize()
|
||||
void ParallelReplicasReadingCoordinator::initialize(CoordinationMode mode)
|
||||
{
|
||||
switch (mode)
|
||||
{
|
||||
|
@ -31,12 +31,11 @@ public:
|
||||
void setProgressCallback(ProgressCallback callback);
|
||||
|
||||
private:
|
||||
void initialize();
|
||||
void initialize(CoordinationMode mode);
|
||||
|
||||
std::mutex mutex;
|
||||
size_t replicas_count{0};
|
||||
size_t mark_segment_size{0};
|
||||
CoordinationMode mode{CoordinationMode::Default};
|
||||
std::unique_ptr<ImplInterface> pimpl;
|
||||
ProgressCallback progress_callback; // store the callback only to bypass it to coordinator implementation
|
||||
std::set<size_t> replicas_used;
|
||||
|
Loading…
Reference in New Issue
Block a user