Scrub all chunks, not just 1 chunk per position

This commit is contained in:
Vitaliy Filippov
2025-01-23 02:02:55 +03:00
parent 4636e02d43
commit bcefa42bc0
10 changed files with 523 additions and 380 deletions
+6 -4
View File
@@ -1160,24 +1160,26 @@ void test_ec43_error_bruteforce()
stripes[i].read_end = 4096;
stripes[i].read_buf = write_buf+i*4096;
stripes[i].write_buf = NULL;
stripes[i].role = i;
stripes[i].osd_num = i+1;
}
// All good chunks
auto res = ec_find_good(stripes, 7, 4, false, 4096, 0, 100);
auto res = ec_find_good(stripes, 7, 7, 4, false, 4096, 0, 100, true);
assert_eq_vec(res, std::vector<int>({0, 1, 2, 3, 4, 5, 6}));
// 1 missing chunk
set_pattern(write_buf+1*4096, 4096, 0);
res = ec_find_good(stripes, 7, 4, false, 4096, 0, 100);
res = ec_find_good(stripes, 7, 7, 4, false, 4096, 0, 100, true);
assert_eq_vec(res, std::vector<int>({0, 2, 3, 4, 5, 6}));
// 2 missing chunks
set_pattern(write_buf+1*4096, 4096, 0);
set_pattern(write_buf+5*4096, 4096, 0);
res = ec_find_good(stripes, 7, 4, false, 4096, 0, 100);
res = ec_find_good(stripes, 7, 7, 4, false, 4096, 0, 100, true);
assert_eq_vec(res, std::vector<int>({0, 2, 3, 4, 6}));
// 3 missing chunks
set_pattern(write_buf+1*4096, 4096, 0);
set_pattern(write_buf+5*4096, 4096, 0);
set_pattern(write_buf+6*4096, 4096, 0);
res = ec_find_good(stripes, 7, 4, false, 4096, 0, 100);
res = ec_find_good(stripes, 7, 7, 4, false, 4096, 0, 100, true);
assert_eq_vec(res, std::vector<int>());
// Done
free(rmw_buf);