// write arrives before trimtrunc
if (os.exists && !os.oi.is_whiteout()) {
txn.truncate(coll->get_cid(),
- ghobject_t{os.oi.soid}, op.extent.truncate_size);
+ ghobject_t{os.oi.soid}, op.extent.truncate_size);
+ if (op.extent.truncate_size != os.oi.size) {
+ os.oi.size = length;
+ // TODO: truncate_update_size_and_usage()
+ }
}
os.oi.truncate_seq = op.extent.truncate_seq;
os.oi.truncate_size = op.extent.truncate_size;
} else {
txn.write(coll->get_cid(), ghobject_t{os.oi.soid},
offset, length, std::move(buf), op.flags);
+ os.oi.size = std::max(offset + length, os.oi.size);
}
return seastar::now();
}