Fix zero used space, update mtime when moving/changing inode
Test / buildenv (push) Successful in 10s Details
Test / build (push) Successful in 3m8s Details
Test / test_cas (push) Successful in 8s Details
Test / make_test (push) Successful in 34s Details
Test / test_change_pg_size (push) Successful in 6s Details
Test / test_change_pg_count (push) Successful in 35s Details
Test / test_change_pg_count_ec (push) Successful in 32s Details
Test / test_create_nomaxid (push) Successful in 6s Details
Test / test_etcd_fail (push) Successful in 51s Details
Test / test_add_osd (push) Successful in 2m38s Details
Test / test_interrupted_rebalance_imm (push) Successful in 1m54s Details
Test / test_failure_domain (push) Successful in 39s Details
Test / test_interrupted_rebalance (push) Successful in 2m51s Details
Test / test_snapshot (push) Successful in 17s Details
Test / test_interrupted_rebalance_ec (push) Successful in 2m9s Details
Test / test_minsize_1 (push) Successful in 13s Details
Test / test_move_reappear (push) Successful in 20s Details
Test / test_rm (push) Successful in 15s Details
Test / test_snapshot_ec (push) Successful in 35s Details
Test / test_interrupted_rebalance_ec_imm (push) Successful in 1m30s Details
Test / test_snapshot_down (push) Successful in 30s Details
Test / test_snapshot_down_ec (push) Successful in 29s Details
Test / test_splitbrain (push) Successful in 23s Details
Test / test_snapshot_chain (push) Successful in 2m16s Details
Test / test_snapshot_chain_ec (push) Successful in 2m45s Details
Test / test_rebalance_verify_imm (push) Successful in 5m11s Details
Test / test_rebalance_verify (push) Successful in 5m56s Details
Test / test_switch_primary (push) Successful in 33s Details
Test / test_rebalance_verify_ec_imm (push) Successful in 4m21s Details
Test / test_write_no_same (push) Successful in 15s Details
Test / test_write (push) Successful in 1m2s Details
Test / test_write_xor (push) Successful in 1m27s Details
Test / test_rebalance_verify_ec (push) Successful in 8m8s Details
Test / test_heal_pg_size_2 (push) Successful in 4m11s Details
Test / test_heal_csum_32k_dmj (push) Successful in 4m41s Details
Test / test_heal_csum_32k_dj (push) Successful in 6m4s Details
Test / test_heal_csum_32k (push) Successful in 6m1s Details
Test / test_heal_ec (push) Failing after 10m32s Details
Test / test_heal_csum_4k_dmj (push) Successful in 6m2s Details
Test / test_scrub (push) Successful in 1m27s Details
Test / test_scrub_zero_osd_2 (push) Successful in 1m10s Details
Test / test_scrub_xor (push) Successful in 1m11s Details
Test / test_heal_csum_4k_dj (push) Successful in 5m27s Details
Test / test_scrub_pg_size_6_pg_minsize_4_osd_count_6_ec (push) Successful in 1m26s Details
Test / test_scrub_pg_size_3 (push) Successful in 2m24s Details
Test / test_nfs (push) Successful in 34s Details
Test / test_scrub_ec (push) Successful in 55s Details
Test / test_heal_csum_4k (push) Successful in 5m10s Details

Vitaliy Filippov 2024-03-09 14:58:42 +03:00
parent f138424a46
commit ba574afb1f
2 changed files with 7 additions and 2 deletions

View File

@ -72,7 +72,7 @@ fattr3 get_kv_attributes(nfs_client_t *self, uint64_t ino, json11::Json attrs)
auto nlink = attrs["nlink"].uint64_value();
nfstime3 mtime = nfstime_from_str(attrs["mtime"].string_value());
nfstime3 atime = attrs["atime"].is_null() ? mtime : nfstime_from_str(attrs["atime"].string_value());
// FIXME In theory we could store the binary structure itself instead of JSON
// In theory we could store the binary structure itself, but JSON is simpler :-)
return (fattr3){
.type = (type == 0 ? NF3REG : (ftype3)type),
.mode = (attrs["mode"].is_null() ? (type == NF3DIR ? 0755 : 0644) : (uint32_t)mode),
@ -80,7 +80,8 @@ fattr3 get_kv_attributes(nfs_client_t *self, uint64_t ino, json11::Json attrs)
.uid = (uint32_t)attrs["uid"].uint64_value(),
.gid = (uint32_t)attrs["gid"].uint64_value(),
.size = (type == NF3DIR ? 4096 : attrs["size"].uint64_value()),
.used = (type == NF3DIR ? 4096 : attrs["alloc"].uint64_value()),
// FIXME Counting actual used file size would require reworking statistics
.used = (type == NF3DIR ? 4096 : attrs["size"].uint64_value()),
.rdev = (type == NF3BLK || type == NF3CHR
? (specdata3){ (uint32_t)attrs["major"].uint64_value(), (uint32_t)attrs["minor"].uint64_value() }
: (specdata3){}),

View File

@ -512,6 +512,7 @@ static std::string new_normal_ientry(nfs_kv_write_state *st)
ni.erase("shared_alloc");
ni.erase("shared_ver");
ni["size"] = st->ext->cur_extend;
ni["mtime"] = nfstime_now_str();
return json11::Json(ni).dump();
}
@ -524,6 +525,7 @@ static std::string new_moved_ientry(nfs_kv_write_state *st)
ni["shared_alloc"] = st->aligned_size;
ni.erase("shared_ver");
ni["size"] = st->new_size;
ni["mtime"] = nfstime_now_str();
return json11::Json(ni).dump();
}
@ -532,6 +534,7 @@ static std::string new_shared_ientry(nfs_kv_write_state *st)
auto ni = st->ientry.object_items();
ni.erase("empty");
ni["size"] = st->new_size;
ni["mtime"] = nfstime_now_str();
ni["shared_ver"] = ni["shared_ver"].uint64_value()+1;
return json11::Json(ni).dump();
}
@ -544,6 +547,7 @@ static std::string new_unshared_ientry(nfs_kv_write_state *st)
ni.erase("shared_offset");
ni.erase("shared_alloc");
ni.erase("shared_ver");
ni["mtime"] = nfstime_now_str();
return json11::Json(ni).dump();
}