]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
rgw/dbstore: Object versioning feature support
authorSoumya Koduri <skoduri@redhat.com>
Wed, 25 May 2022 08:30:34 +0000 (14:00 +0530)
committerSoumya Koduri <skoduri@redhat.com>
Mon, 25 Jul 2022 06:07:08 +0000 (11:37 +0530)
commitb43a755acc6a31a538f53c2da5e19e0ee803f2ee
treef559b8afc448b1828ae1478049902467a0e93216
parenta421cfc2aa0eef2d1ef171ee706c24aa0e8234bb
rgw/dbstore: Object versioning feature support

This commit adds support for Object versioning feature in DBStore

In DBStore, each object is uniquely identified by <objectName, objectNS, instance-id>
In addition, for each object upload, a unique objectID is created to handle racing writes.
Note: For non-versioned objects, both head and tail entries have instance-id empty ""

Versioned objects:
 - same as non-versioned objects but with instance-id & objectID set to version-id i.e,
   each version upload will have a unique versionID created which will act as that object's intanceID and objectID as well.
 - In addition a version-number is stored (starting with '1' & incremented sequentially) for each version/delete-marker being created for that object.
   This version-number is used to identify and promote/demote next object version as CURRENT.

Current status:
- Basic functionality seem to be working when the bucket is versioned.
- If an object is removed, only one delete-marker is created for now. Subsequent deletes will be no-op (unless the object is re-created & deleted with the same name)
- Added test cases to test put/get/delete/list of versioned objects

TODO (not addressed as part of this PR):
- Test various cases with versioning suspended & enabled.

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