Skip to content

Commit 48080c9

Browse files
committed
Fix device list for test_raft_repl_dev.
Previous code will add `ndevices` simulated drive into device list which make each replica go with one real drive and ndevices simulated drive. Those simulated drives are identified as FAST, meta/log were on them. Due to the very limited size of simulated drive, we can hit size limit in long running test. Fixing by honor input from hs_repl_test_common. After this fix, if only one drive passed in for a replica of test_raft_repl_dev, that drive will be used as FAST. All services will be started on that real drive. Signed-off-by: Xiaoxi Chen <xiaoxchen@ebay.com>
1 parent 3f3c0f3 commit 48080c9

File tree

3 files changed

+16
-4
lines changed

3 files changed

+16
-4
lines changed

conanfile.py

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

1010
class HomestoreConan(ConanFile):
1111
name = "homestore"
12-
version = "6.4.31"
13-
12+
version = "6.4.32"
1413
homepage = "https://github.com/eBay/Homestore"
1514
description = "HomeStore Storage Engine"
1615
topics = ("ebay", "nublox")

src/tests/test_common/homestore_test_common.hpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,14 @@ class HSTestHelper {
344344
// Fake restart, device list is unchanged.
345345
shutdown_homestore(false);
346346
std::this_thread::sleep_for(std::chrono::seconds{shutdown_delay_sec});
347+
} else if (!m_token.devs_.empty()) {
348+
// For those UTs already process device list, like test_raft_repl_dev.
349+
LOGINFO("Using passed in dev_list: {}",
350+
std::accumulate(m_token.devs_.begin(), m_token.devs_.end(), std::string(""),
351+
[](const std::string& s, const homestore::dev_info& dinfo) {
352+
return s.empty() ? dinfo.dev_name : s + "," + dinfo.dev_name;
353+
}));
354+
347355
} else if (SISL_OPTIONS.count("device_list")) {
348356
// User has provided explicit device list, use that and initialize them
349357
auto const devs = SISL_OPTIONS["device_list"].as< std::vector< std::string > >();
@@ -425,6 +433,9 @@ class HSTestHelper {
425433
set_min_chunk_size(m_token.svc_params_[HS_SERVICE::LOG].min_chunk_size);
426434
}
427435

436+
// in UT we assume first drive is FAST, rest are DATA.
437+
bool has_data_drive = m_token.devs_.size() > 1;
438+
428439
if (need_format) {
429440
auto svc_params = m_token.svc_params_;
430441
hsi->format_and_start(
@@ -444,7 +455,8 @@ class HSTestHelper {
444455
: chunk_selector_type_t::ROUND_ROBIN}},
445456
{HS_SERVICE::INDEX, {.size_pct = svc_params[HS_SERVICE::INDEX].size_pct}},
446457
{HS_SERVICE::REPLICATION,
447-
{.size_pct = svc_params[HS_SERVICE::REPLICATION].size_pct,
458+
{.dev_type = has_data_drive ? homestore::HSDevType::Data : homestore::HSDevType::Fast,
459+
.size_pct = svc_params[HS_SERVICE::REPLICATION].size_pct,
448460
.alloc_type = svc_params[HS_SERVICE::REPLICATION].blkalloc_type,
449461
.chunk_sel_type = svc_params[HS_SERVICE::REPLICATION].custom_chunk_selector
450462
? chunk_selector_type_t::CUSTOM

src/tests/test_common/hs_repl_test_common.hpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ class HSReplTestHelper : public HSTestHelper {
168168
}
169169
}
170170
for (auto const& dev : rdev_list[replica_num_]) {
171-
dev_list_.emplace_back(dev, homestore::HSDevType::Data);
171+
dev_list_.emplace_back(dev,
172+
dev_list_.empty() ? homestore::HSDevType::Fast : homestore::HSDevType::Data);
172173
}
173174
}
174175

0 commit comments

Comments
 (0)