Fix peering_pg, begin tests
This commit is contained in:
@@ -26,7 +26,6 @@
|
||||
|
||||
#include "blockstore.h"
|
||||
#include "blockstore_impl.h"
|
||||
#include "osd_peering_pg.h"
|
||||
//#include "cpp-btree/btree_map.h"
|
||||
|
||||
static int setup_context(unsigned entries, struct io_uring *ring)
|
||||
@@ -337,44 +336,6 @@ int main04(int argc, char *argv[])
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main05(int argc, char *argv[])
|
||||
{
|
||||
// FIXME extract this into a test
|
||||
pg_t pg = {
|
||||
.state = PG_PEERING,
|
||||
.pg_num = 1,
|
||||
.target_set = { 1, 2, 3 },
|
||||
.cur_set = { 1, 2, 3 },
|
||||
.peering_state = new pg_peering_state_t(),
|
||||
};
|
||||
for (uint64_t osd_num = 1; osd_num <= 3; osd_num++)
|
||||
{
|
||||
pg_list_result_t r = {
|
||||
.buf = (obj_ver_id*)malloc(sizeof(obj_ver_id) * 1024*1024*8),
|
||||
.total_count = 1024*1024*8,
|
||||
.stable_count = (uint64_t)(1024*1024*8 - (osd_num == 1 ? 10 : 0)),
|
||||
};
|
||||
for (uint64_t i = 0; i < r.total_count; i++)
|
||||
{
|
||||
r.buf[i] = {
|
||||
.oid = {
|
||||
.inode = 1,
|
||||
.stripe = (i << STRIPE_SHIFT) | (osd_num-1),
|
||||
},
|
||||
.version = (uint64_t)(osd_num == 1 && i >= r.total_count - 10 ? 2 : 1),
|
||||
};
|
||||
}
|
||||
pg.peering_state->list_results[osd_num] = r;
|
||||
}
|
||||
pg.calc_object_states();
|
||||
printf("deviation variants=%ld clean=%lu\n", pg.state_dict.size(), pg.clean_count);
|
||||
for (auto it: pg.state_dict)
|
||||
{
|
||||
printf("dev: state=%lx\n", it.second.state);
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
timeval fill_start, fill_end, filter_end;
|
||||
|
||||
Reference in New Issue
Block a user