Skip to content

Commit 7a1e741

Browse files
committed
address comments
1 parent 651d6e4 commit 7a1e741

File tree

3 files changed

+9
-6
lines changed

3 files changed

+9
-6
lines changed

src/Storages/MergeTree/ExportPartTask.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ bool ExportPartTask::executeStep()
137137
}
138138
}
139139

140-
LOG_INFO(getLogger("ExportPartTask"), "Export part {} failed: {}", manifest.data_part->name, e.message());
140+
LOG_WARNING(getLogger("ExportPartTask"), "Export part {} failed: {}", manifest.data_part->name, e.message());
141141

142142
ProfileEvents::increment(ProfileEvents::PartsExportFailures);
143143

src/Storages/MergeTree/ExportPartitionManifestUpdatingTask.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -401,7 +401,7 @@ std::vector<ReplicatedPartitionExportInfo> ExportPartitionManifestUpdatingTask::
401401
{
402402
if (!count_str.empty())
403403
{
404-
exception_count += std::stoull(count_str);
404+
exception_count += parse<size_t>(count_str);
405405
}
406406
if (last_exception.empty() && !exception_str.empty() && !part_str.empty())
407407
{
@@ -478,10 +478,11 @@ void ExportPartitionManifestUpdatingTask::poll()
478478
LOG_INFO(storage.log, "ExportPartition Manifest Updating Task: Cleanup lock acquired, will remove stale entries");
479479
}
480480

481-
Coordination::Stat stat;
482-
const auto children = zk->getChildrenWatch(exports_path, &stat, storage.export_merge_tree_partition_watch_callback);
483481
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperRequests);
484482
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperGetChildrenWatch);
483+
484+
Coordination::Stat stat;
485+
const auto children = zk->getChildrenWatch(exports_path, &stat, storage.export_merge_tree_partition_watch_callback);
485486
const std::unordered_set<std::string> zk_children(children.begin(), children.end());
486487

487488
const auto now = time(nullptr);

src/Storages/MergeTree/ExportPartitionTaskScheduler.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ void ExportPartitionTaskScheduler::run()
7474
std::size_t scheduled_exports_count = 0;
7575

7676
const uint32_t seed = uint32_t(std::hash<std::string>{}(storage.replica_name)) ^ uint32_t(scheduled_exports_count);
77-
std::mt19937 rng(seed);
77+
pcg64_fast rng(seed);
7878

7979
std::lock_guard lock(storage.export_merge_tree_partition_mutex);
8080

@@ -261,6 +261,8 @@ void ExportPartitionTaskScheduler::run()
261261
catch (const Exception &)
262262
{
263263
tryLogCurrentException(__PRETTY_FUNCTION__);
264+
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperRequests);
265+
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperRemove);
264266
zk->tryRemove(fs::path(storage.zookeeper_path) / "exports" / key / "locks" / zk_part_name);
265267
/// we should not increment retry_count because the node might just be full
266268
}
@@ -417,7 +419,7 @@ void ExportPartitionTaskScheduler::handlePartExportFailure(
417419
zk->tryGet(count_path, num_exceptions_string);
418420
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperRequests);
419421
ProfileEvents::increment(ProfileEvents::ExportPartitionZooKeeperGet);
420-
num_exceptions = std::stoull(num_exceptions_string.c_str());
422+
num_exceptions = parse<size_t>(num_exceptions_string);
421423

422424
ops.emplace_back(zkutil::makeSetRequest(last_exception_path / "part", part_name, -1));
423425
ops.emplace_back(zkutil::makeSetRequest(last_exception_path / "exception", exception->message(), -1));

0 commit comments

Comments
 (0)