osd: Test a lost peering flush primary on EC 8+2 #218

Open
koolkhel wants to merge 3 commits from koolkhel/vitastor:peering-flush-ec82-test into master

View File

@@ -4707,7 +4707,8 @@ static void peer_without_and_with_osd1(ec_scheme_t ec, std::map<osd_num_t, ec_pa
// Version 2 of object A is written to OSDs 1..<written> of an EC PG, unstable. OSD 1 peers, flushes it and
// loses its peers right after its own part is flushed. The others peer without it, and then it comes back.
// When OSD 1 has stabilized its part, the others must not roll version 2 back: its stable part on OSD 1
// would then make the object incomplete. While they hold pg_data_size parts of it, the PG must be active
// would then make the object incomplete. While they hold pg_data_size parts of it, the PG must be active,
// otherwise it must wait for OSD 1
void test_peering_flush_primary_lost(ec_scheme_t ec, int written)
{
printf("test_peering_flush_primary_lost[EC %d+%d, pg_minsize %d, v2 on %d]\n", ec.data, ec.parity, ec.pg_minsize, written);
@@ -4723,7 +4724,7 @@ void test_peering_flush_primary_lost(ec_scheme_t ec, int written)
bool active_without = false, complete = false;
peer_without_and_with_osd1(ec, parts, history, active_without, complete);
assert(complete);
assert(active_without || written == ec.data);
assert(active_without == (written > ec.data));
printf("test_peering_flush_primary_lost[EC %d+%d, pg_minsize %d, v2 on %d] passed\n", ec.data, ec.parity, ec.pg_minsize, written);
}
@@ -5709,6 +5710,7 @@ int main(int narg, char *args[])
test_peering_flush_primary_lost({ 3, 2, 4 }, 3);
test_peering_flush_primary_lost({ 3, 2, 4 }, 4);
test_peering_flush_primary_lost({ 3, 2, 4 }, 5);
test_peering_flush_primary_lost({ 8, 2, 9 }, 8);
test_degraded_write_primary_lost({ 2, 1, 2 });
test_degraded_write_primary_lost({ 3, 2, 4 });
test_peering_flush_then_holder_lost({ 2, 1, 2 }, 2, 2);