From 76872b0aa43ab6169a41a4d5223f268fac5611c3 Mon Sep 17 00:00:00 2001 From: Yury Luneff Date: Tue, 1 Dec 2026 22:01:56 +0300 Subject: [PATCH 1/3] osd: Test a lost peering flush primary on EC 8+2 and on 3+2 with pg_minsize 3 Cover a wide scheme, EC 8+2 with pg_minsize 9, where the PG could activate without the old primary on its 7 other holders plus the 2 OSDs that never got the version, and pg_minsize equal to the number of data chunks on 3+2. The same sequences fail at assert(complete) on a tree without ac3f6f85. --- src/test/osd_test.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/test/osd_test.cpp b/src/test/osd_test.cpp index 3921c6ab..d04226eb 100644 --- a/src/test/osd_test.cpp +++ b/src/test/osd_test.cpp @@ -5709,6 +5709,8 @@ 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({ 3, 2, 3 }, 3); + 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); -- 2.47.3 From 1ead7bcb06a9818747788fc290680167401be13d Mon Sep 17 00:00:00 2001 From: Yury Luneff Date: Wed, 2 Dec 2026 01:11:45 +0300 Subject: [PATCH 2/3] osd: Require the PG to wait for a lost flush primary when the rest hold fewer than pg_data_size parts With v2 on exactly pg_data_size parts, the test accepted either outcome for activation without OSD 1. Assert that the PG waits for it, as the history of the holders requires. --- src/test/osd_test.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/test/osd_test.cpp b/src/test/osd_test.cpp index d04226eb..629d022c 100644 --- a/src/test/osd_test.cpp +++ b/src/test/osd_test.cpp @@ -4707,7 +4707,8 @@ static void peer_without_and_with_osd1(ec_scheme_t ec, std::map 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); } -- 2.47.3 From b4bb591111d734b1744d7fd16cf6f8f779e2a352 Mon Sep 17 00:00:00 2001 From: Yury Luneff Date: Wed, 2 Dec 2026 01:12:56 +0300 Subject: [PATCH 3/3] osd: Drop the EC 3+2 pg_minsize 3 case of the lost flush primary test pg_minsize only gates pg_cursize, which stays at 4 when only OSD 1 is lost, so the case repeated the pg_minsize 4 one. --- src/test/osd_test.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/test/osd_test.cpp b/src/test/osd_test.cpp index 629d022c..f19b3978 100644 --- a/src/test/osd_test.cpp +++ b/src/test/osd_test.cpp @@ -5710,7 +5710,6 @@ 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({ 3, 2, 3 }, 3); 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 }); -- 2.47.3