]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/rados: add concurrent io algorithms for sharded data
authorCasey Bodley <cbodley@redhat.com>
Thu, 7 Nov 2024 20:36:45 +0000 (15:36 -0500)
committerCasey Bodley <cbodley@redhat.com>
Tue, 8 Apr 2025 15:45:22 +0000 (11:45 -0400)
commit2c6f777f83ba9ea355d148ad5df85959c7ebd22b
treeb3772daf70e8c581e635e89e5c497f28bdbacca1
parent76302acc2eb130fe8c594cba56b80b21602bb438
rgw/rados: add concurrent io algorithms for sharded data

cls/rgw provides the base class CLSRGWConcurrentIO as a swiss army knife
for bucket index operations that visit every shard object. while it uses
asynchronous librados requests to perform the io, it blocks on a
condition variable when waiting for the AioCompletions.

for use in coroutines, we need a version of this that suspends instead
of blocking. and to support both stackful and stackless coroutines, we
want a fully-generic async inferface templated on CompletionToken.

while the CLSRGWConcurrentIO algorithm works for all current uses
(reads and writes, with/without retries, with/without cleanup), i chose
to break this into 3 algorithms with well-defined semantics:

1. reads: to produce a successful result, all shard operations must
   succeed. so any shard's failure causes the rest to be cancelled or
   skipped. supports retries for ListBucket (RGWBIAdvanceAndRetryError).
2. writes: even if some shards fail, we still want to visit every shard
   before returning the error. supports retries for log trimming
   operations (repeat until ENODATA).
3. revertible writes: similar to reads, requires all shard operations to
   succeed. on any failure, the side effects of any successful writes
   must be reverted before returning. only used by IndexInit (any created
   shards are removed on failure).

each algorithm provides a pure virtual base class that must be
implemented for each type of operation, similar to how existing
operations inherit from CLSRGWConcurrentIO.

Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/driver/rados/shard_io.h [new file with mode: 0644]
src/test/rgw/CMakeLists.txt
src/test/rgw/test_rgw_shard_io.cc [new file with mode: 0644]