Fix shared file overlap, add FIXMEs
Test / buildenv (push) Successful in 15s Details
Test / build (push) Successful in 3m22s Details
Test / test_cas (push) Successful in 7s Details
Test / make_test (push) Successful in 33s Details
Test / test_change_pg_count (push) Successful in 34s Details
Test / test_change_pg_size (push) Successful in 7s Details
Test / test_change_pg_count_ec (push) Successful in 34s Details
Test / test_create_nomaxid (push) Successful in 7s Details
Test / test_etcd_fail (push) Successful in 50s Details
Test / test_add_osd (push) Successful in 2m38s Details
Test / test_interrupted_rebalance_imm (push) Successful in 2m0s Details
Test / test_failure_domain (push) Successful in 44s Details
Test / test_interrupted_rebalance_ec (push) Successful in 2m6s Details
Test / test_interrupted_rebalance (push) Successful in 2m53s Details
Test / test_snapshot (push) Successful in 17s Details
Test / test_minsize_1 (push) Successful in 12s Details
Test / test_snapshot_ec (push) Successful in 29s Details
Test / test_interrupted_rebalance_ec_imm (push) Successful in 1m28s Details
Test / test_rm (push) Successful in 16s Details
Test / test_move_reappear (push) Successful in 22s Details
Test / test_snapshot_down (push) Successful in 32s Details
Test / test_snapshot_down_ec (push) Successful in 30s Details
Test / test_splitbrain (push) Successful in 20s Details
Test / test_snapshot_chain (push) Successful in 2m26s Details
Test / test_snapshot_chain_ec (push) Successful in 3m1s Details
Test / test_rebalance_verify_imm (push) Successful in 5m18s Details
Test / test_rebalance_verify (push) Successful in 5m53s Details
Test / test_switch_primary (push) Successful in 33s Details
Test / test_write (push) Successful in 51s Details
Test / test_write_no_same (push) Successful in 14s Details
Test / test_rebalance_verify_ec_imm (push) Successful in 4m36s Details
Test / test_write_xor (push) Successful in 54s Details
Test / test_rebalance_verify_ec (push) Successful in 8m49s Details
Test / test_heal_pg_size_2 (push) Successful in 4m39s Details
Test / test_heal_csum_32k_dmj (push) Successful in 4m36s Details
Test / test_heal_ec (push) Successful in 4m39s Details
Test / test_heal_csum_32k_dj (push) Successful in 5m58s Details
Test / test_heal_csum_4k_dj (push) Successful in 5m57s Details
Test / test_heal_csum_32k (push) Successful in 6m1s Details
Test / test_heal_csum_4k_dmj (push) Successful in 6m0s Details
Test / test_scrub_zero_osd_2 (push) Successful in 41s Details
Test / test_scrub_xor (push) Successful in 40s Details
Test / test_scrub (push) Successful in 45s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 1m3s Details
Test / test_scrub_ec (push) Successful in 1m1s Details
Test / test_scrub_pg_size_3 (push) Successful in 1m33s Details
Test / test_nfs (push) Successful in 32s Details
Test / test_heal_csum_4k (push) Successful in 4m47s Details

Vitaliy Filippov 2024-03-03 01:07:52 +03:00
parent c5cfa6fd96
commit f197544463
3 changed files with 16 additions and 6 deletions

View File

@ -153,6 +153,7 @@ void cli_tool_t::loop_and_wait(std::function<bool(cli_result_t &)> loop_cb, std:
ringloop->unregister_consumer(&looper->consumer);
looper->loop_cb = NULL;
looper->complete_cb(looper->result);
ringloop->submit();
delete looper;
return;
}

View File

@ -25,6 +25,7 @@ struct nfs_kv_setattr_state
static void nfs_kv_continue_setattr(nfs_kv_setattr_state *st, int state)
{
// FIXME: NFS client does a lot of setattr calls, so maybe process them asynchronously
if (state == 0) {}
else if (state == 1) goto resume_1;
else if (state == 2) goto resume_2;
@ -50,8 +51,7 @@ resume_1:
cb(st->res);
return;
}
if (st->ientry["type"].string_value() == "link" ||
st->ientry["type"].string_value() != "file" &&
if (st->ientry["type"].string_value() != "file" &&
st->ientry["type"].string_value() != "" &&
!st->set_attrs["size"].is_null())
{

View File

@ -151,9 +151,11 @@ static void nfs_do_write(uint64_t ino, uint64_t offset, uint64_t size, std::func
static void nfs_do_unshare_write(nfs_kv_write_state *st, int state)
{
nfs_do_write(st->ino, 0, st->aligned_size - sizeof(shared_file_header_t), [&](cluster_op_t *op)
uint64_t unshare_size = (st->ientry["size"].uint64_value() + st->self->parent->pool_alignment-1)
& ~(st->self->parent->pool_alignment-1);
nfs_do_write(st->ino, 0, unshare_size, [&](cluster_op_t *op)
{
op->iov.push_back(st->aligned_buf + sizeof(shared_file_header_t), st->aligned_size - sizeof(shared_file_header_t));
op->iov.push_back(st->aligned_buf + sizeof(shared_file_header_t), unshare_size);
}, st, state);
}
@ -292,6 +294,7 @@ static bool nfs_do_shared_readmodify(nfs_kv_write_state *st, int base_state, int
? sizeof(shared_file_header_t) + ((st->new_size + st->self->parent->pool_alignment-1) & ~(st->self->parent->pool_alignment-1))
: align_shared_size(st->self, st->new_size);
st->aligned_buf = (uint8_t*)malloc_or_die(st->aligned_size);
// FIXME do not allocate zeroes if we only need zeroes
memset(st->aligned_buf + sizeof(shared_file_header_t), 0, st->offset);
memset(st->aligned_buf + sizeof(shared_file_header_t) + st->offset + st->size, 0,
st->aligned_size - sizeof(shared_file_header_t) - st->offset - st->size);
@ -319,6 +322,7 @@ resume_0:
return false;
}
}
// FIXME put shared_file_header_t after data to not break alignment
*((shared_file_header_t*)st->aligned_buf) = {
.magic = SHARED_FILE_MAGIC_V1,
.inode = st->ino,
@ -679,7 +683,7 @@ resume_1:
st->ientry["shared_alloc"].uint64_value() < sizeof(shared_file_header_t)+st->offset+st->size)
{
// Either empty, or shared and requires moving into a larger place (redirect-write)
allocate_shared_inode(st, 2, st->new_size);
allocate_shared_inode(st, 2, align_shared_size(st->self, st->new_size));
return;
resume_2:
if (st->res < 0)
@ -783,7 +787,12 @@ resume_10:
nfs_do_unshare_write(st, 11);
return;
resume_11:
;
if (st->res < 0)
{
auto cb = std::move(st->cb);
cb(st->res);
return;
}
}
st->self->parent->db->set(kv_inode_key(st->ino), new_unshared_ientry(st), [st](int res)
{