* \returns the PG info
*/
pg_info_t setup_pg_in_map();
+
+ /**
+ * EC requires that set_stripe_data() is called before the
+ * ScrubBackend object is constructed
+ */
+ virtual void ec_set_stripe_info() {}
};
test_pg = std::make_unique<TestPg>(pool, info, i_am);
std::cout << fmt::format("{}: acting: {}", __func__, acting_shards)
<< std::endl;
+
+ // an EC-only hook to allocate & init the 'stripe conf' structure
+ ec_set_stripe_info();
sbe = std::make_unique<TestScrubBackend>(*test_scrubber,
*test_pg,
i_am,
TestTScrubberBe_data_2() : TestTScrubberBe() {}
// basic test configuration - 3 OSDs, all involved in the pool
- pool_conf_t pl{3, 3, 3, 3, "rep_pool", pg_pool_t::TYPE_REPLICATED,
+ pool_conf_t pl{3, 3, 3, 3, "rep_pool", pg_pool_t::TYPE_REPLICATED,
std::nullopt};
TestTScrubberBeParams inject_params() override
return params;
}
+
+ void ec_set_stripe_info() override
+ {
+ test_pg->set_stripe_info(k, m, k * m_chunk_size, &test_pg->m_pool->info);
+ }
};
class TestTScrubberBeECNoCorruptShards : public TestTScrubberBeECCorruptShards {
};
TEST_F(TestTScrubberBeECNoCorruptShards, ec_parity_inconsistency) {
- test_pg->set_stripe_info(k, m, k * m_chunk_size, &test_pg->m_pool->info);
-
ASSERT_TRUE(sbe); // Assert we have a scrubber backend
logger.set_expected_err_count(
0); // Set the number of errors we expect to see
};
TEST_F(TestTScrubberBeECSingleCorruptDataShard, ec_parity_inconsistency) {
- test_pg->set_stripe_info(k, m, k * m_chunk_size, &test_pg->m_pool->info);
-
ASSERT_TRUE(sbe); // Assert we have a scrubber backend
logger.set_expected_err_count(
1); // Set the number of errors we expect to see
};
TEST_F(TestTScrubberBeECCorruptParityShard, ec_parity_inconsistency) {
- test_pg->set_stripe_info(k, m, k * m_chunk_size, &test_pg->m_pool->info);
-
ASSERT_TRUE(sbe); // Assert we have a scrubber backend
logger.set_expected_err_count(
1); // Set the number of errors we expect to see