Compare commits

...

1 Commits

Author SHA1 Message Date
0d6eeec6a4 Fix osd_peering_pg_test
Some checks failed
Test / test_scrub (push) Blocked by required conditions
Test / test_scrub_zero_osd_2 (push) Blocked by required conditions
Test / test_scrub_xor (push) Blocked by required conditions
Test / test_scrub_pg_size_3 (push) Blocked by required conditions
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Blocked by required conditions
Test / test_scrub_ec (push) Blocked by required conditions
Test / test_old_scrub (push) Blocked by required conditions
Test / test_old_scrub_zero_osd_2 (push) Blocked by required conditions
Test / test_old_scrub_xor (push) Blocked by required conditions
Test / test_old_scrub_pg_size_3 (push) Blocked by required conditions
Test / test_old_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Blocked by required conditions
Test / test_old_scrub_ec (push) Blocked by required conditions
Test / test_old_partwr_csum (push) Blocked by required conditions
Test / test_heal_old_csum_32k_dmj (push) Blocked by required conditions
Test / test_heal_old_csum_32k_dj (push) Blocked by required conditions
Test / test_heal_old_csum_32k (push) Blocked by required conditions
Test / test_heal_old_csum_4k_dmj (push) Blocked by required conditions
Test / test_heal_old_csum_4k_dj (push) Blocked by required conditions
Test / test_heal_old_csum_4k (push) Blocked by required conditions
Test / test_nfs (push) Blocked by required conditions
Test / test_nfs_unaligned_append (push) Blocked by required conditions
Test / make_test (push) Has been cancelled
Test / build (push) Has been cancelled
Test / npm_lint (push) Has been cancelled
Test / test_add_osd (push) Has been cancelled
Test / test_cas (push) Has been cancelled
Test / test_change_pg_count (push) Has been cancelled
Test / test_change_pg_count_ec (push) Has been cancelled
Test / test_change_pg_count_online (push) Has been cancelled
Test / test_change_pg_size (push) Has been cancelled
2026-04-14 02:44:59 +03:00

View File

@@ -1,8 +1,6 @@
// Copyright (c) Vitaliy Filippov, 2019+
// License: VNPL-1.1 (see README.md for details)
#define _LARGEFILE64_SOURCE
#include "malloc_or_die.h"
#include "osd_peering_pg.h"
#define STRIPE_SHIFT 12
@@ -22,13 +20,20 @@
*/
int main(int argc, char *argv[])
{
setvbuf(stdout, NULL, _IONBF, 0);
setvbuf(stderr, NULL, _IONBF, 0);
pg_t pg = {
.state = PG_PEERING,
.scheme = POOL_SCHEME_EC,
.pg_size = 3,
.pg_minsize = 2,
.pg_data_size = 2,
.pg_num = 1,
.target_set = { 1, 2, 3 },
.cur_set = { 1, 2, 3 },
.peering_state = new pg_peering_state_t(),
};
printf("generating\n");
for (uint64_t osd_num = 1; osd_num <= 3; osd_num++)
{
pg_list_result_t r = {
@@ -48,8 +53,15 @@ int main(int argc, char *argv[])
}
pg.peering_state->list_results[osd_num] = r;
}
printf("calculating states\n");
timespec tv0;
clock_gettime(CLOCK_REALTIME, &tv0);
pg.calc_object_states(0);
printf("deviation variants=%jd clean=%ju\n", pg.state_dict.size(), pg.clean_count);
timespec tv1;
clock_gettime(CLOCK_REALTIME, &tv1);
printf("%.2f deviation variants=%jd clean=%ju\n",
(tv1.tv_sec - tv0.tv_sec + tv1.tv_nsec/1000000000.0 - tv0.tv_nsec/1000000000.0),
pg.state_dict.size(), pg.clean_count);
for (auto it: pg.state_dict)
{
printf("dev: state=%jx\n", it.second.state);