Client: Check CAS writes for multiple stripes after slicing them #175
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:cas-multi-stripe"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
3bc5a186("Execute a forced sync before CAS if inode range has dirty data") moved the "atomic writes to multiple stripes are unsupported" check incluster_client_t::execute_cas()aboveslice_rw().op->partsis still empty at that point, so the check never fires. A CAS write or delete that crosses a stripe boundary then sends only its first part (try_send(op, 0, ...)) and reports success with the length of that part, while the rest of the range stays unchanged.For example, with 128 KiB objects, an 8 KiB
vitastor_c_write()at offset 124 KiB withcheck_version= current version + 1 returns 4096: the first object is written and its version is bumped, and the second object is untouched. A CAS delete over the same range returns 0, deletes the first object and leaves the second.This PR does the check after
slice_rw()again, as before3bc5a186.Tested: new
test_cas_cross_objectintest_cluster_client(replicated pool,immediate_commit=all). It fails on master (the write returns 4096, the delete returns 0, and both send their first part), and passes with the fix. A CAS write that ends exactly at the boundary is still sent whole. The rest oftest_cluster_clientpasses.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA