Skip to content

Commit 4f4a98f

Browse files
authored
Issue xxxx: fix solo repl dev physical truncation (#843)
1 parent 53af35a commit 4f4a98f

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

conanfile.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
class HomestoreConan(ConanFile):
1111
name = "homestore"
12-
version = "7.1.1"
12+
version = "7.1.2"
1313

1414
homepage = "https://github.com/eBay/Homestore"
1515
description = "HomeStore Storage Engine"

src/lib/common/resource_mgr.cpp

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -58,11 +58,6 @@ void ResourceMgr::trigger_truncate() {
5858
}
5959

6060
if (hs()->has_repl_data_service()) {
61-
auto& repl_svc = dynamic_cast< GenericReplService& >(hs()->repl_service());
62-
if (repl_svc.get_impl_type() == repl_impl_type::solo) {
63-
// skip truncation from RM for solo repl dev;
64-
return;
65-
}
6661
/*
6762
* DO NOT NEED : raft will truncate logs.
6863
* // first make sure all repl dev's underlying raft log store make corresponding reservation during
@@ -74,6 +69,7 @@ void ResourceMgr::trigger_truncate() {
7469
* });
7570
*/
7671
// next do device truncate which go through all logdevs and truncate them;
72+
HS_LOG_EVERY_N(INFO, base, unmove(50), "Resource manager is triggering truncate");
7773
hs()->logstore_service().device_truncate();
7874
}
7975

@@ -83,7 +79,7 @@ void ResourceMgr::trigger_truncate() {
8379

8480
void ResourceMgr::start_timer() {
8581
auto const res_mgr_timer_ms = HS_DYNAMIC_CONFIG(resource_limits.resource_audit_timer_ms);
86-
LOGINFO("resource audit timer is set to {} usec", res_mgr_timer_ms);
82+
LOGINFO("resource audit timer is set to {} ms", res_mgr_timer_ms);
8783
if (res_mgr_timer_ms == 0) {
8884
LOGINFO("resource audit timer is set to 0, so not starting timer");
8985
return;
@@ -193,8 +189,9 @@ bool ResourceMgr::check_journal_vdev_size(const uint64_t used_size, const uint64
193189
const uint32_t used_pct = (100 * used_size / total_size);
194190
if (used_pct >= get_journal_vdev_size_limit()) {
195191
m_journal_vdev_exceed_cb(used_size, used_pct >= get_journal_vdev_size_critical_limit() /* is_critical */);
196-
HS_LOG_EVERY_N(WARN, base, unmove(50), "high watermark hit, used percentage: {}, high watermark percentage: {}",
197-
used_pct, get_journal_vdev_size_limit());
192+
HS_LOG_EVERY_N(WARN, base, unmove(50),
193+
"high watermark hit, used percentage: {}, high watermark percentage: {}", used_pct,
194+
get_journal_vdev_size_limit());
198195
return true;
199196
}
200197
}

src/lib/logstore/log_store_service.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -325,8 +325,10 @@ void LogStoreService::device_truncate() {
325325
// TODO: make device_truncate_under_lock return future and do collectAllFutures;
326326
if (is_stopping()) return;
327327
incr_pending_request_num();
328-
for (auto& [id, logdev] : m_id_logdev_map)
328+
for (auto& [id, logdev] : m_id_logdev_map) {
329+
HS_LOG(DEBUG, logstore, "Truncating logdev {}", id);
329330
logdev->truncate();
331+
}
330332
decr_pending_request_num();
331333
}
332334

0 commit comments

Comments
 (0)