]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/dbstore: Handle read vs delete races
authorSoumya Koduri <skoduri@redhat.com>
Thu, 3 Feb 2022 18:55:22 +0000 (00:25 +0530)
committerSoumya Koduri <skoduri@redhat.com>
Tue, 8 Feb 2022 15:26:30 +0000 (20:56 +0530)
commit65ca2f53b80416ba3070293b294048c16efcda9a
tree1c5194a47a9df19e376659398a847e08cf154c79
parenta5627d60395915e5f57e6c12293d8221a218f8fe
rgw/dbstore: Handle read vs delete races

Now that tail objects are associated with objectID, they are not deleted
as part of this DeleteObj operation. Such tail objects (with no head object
in *.object.table are cleaned up later by GC thread.

To avoid races between writes/reads & GC delete, mtime is maintained for each
tail object. This mtime is updated when tail object is written and also when
its corresponding head object is deleted (like here in this case).

Also done some cleanup.

Signed-off-by: Soumya Koduri <skoduri@redhat.com>
src/rgw/store/dbstore/common/dbstore.cc
src/rgw/store/dbstore/common/dbstore.h
src/rgw/store/dbstore/sqlite/sqliteDB.cc
src/rgw/store/dbstore/sqlite/sqliteDB.h
src/rgw/store/dbstore/tests/dbstore_tests.cc