-
Notifications
You must be signed in to change notification settings - Fork 10
rgw/sfs: Implement new versioning design #153
Conversation
09f046d
to
c988114
Compare
6d645aa
to
9aa8030
Compare
9aa8030
to
def1dd6
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
generally looks good, but a few comments I'd like answers to before approving or requesting changes :)
src/rgw/driver/sfs/sqlite/versioned_object/versioned_object_definitions.h
Show resolved
Hide resolved
def1dd6
to
ada0866
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cleanup related, otherwise looks good.
ada0866
to
a32f63e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good!
I like how the code now leverages more of sqlite_orm.
General comments:
Some of the sql utility methods would benefit from names that imply if deleted is included or now.
The '_' prefix. I've seen it in the python word for private methods, but not much in c++. What does it mean here? Just private method? Utility method? Method doing actual work (like the do_ prefix in many parts of the ceph codebase)
return _get_versioned_object(bucket_id, object_name, version_id); | ||
} | ||
|
||
DBObjectsListItems SQLiteVersionedObjects::list_last_versioned_objects( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest to include the state the objects are in. The name does not imply that deleted objects are filtered out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
okay, sounds good to me. I've renamed it to get_non_deleted_versioned_object
@@ -238,12 +256,10 @@ bool SFSBucket::is_owner(User* user) { | |||
int SFSBucket::check_empty(const DoutPrefixProvider* dpp, optional_yield y) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Goold candidate to turn into an sql query in a future PR. )
Q: What is empty?
there is no committed version?
there is no committed or open (== in flight) version?
🤔 is a bucket empty if there are multpart uploads going on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I wonder if there are any s3 tests
for this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Surprising to me check_empty is only called from RGWDeleteBucket::execute before doing the remove_bucket call. Surprising because I would have expected that to be part of remove_bucket
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The answer here needs to be, I think, that the multipart uploads are simply aborted if the bucket is removed. The multipart upload is a promise of eventually creating something in that bucket, and as such I don't think it's reasonable to hold the bucket to exist just because someone forgot to complete or abort a multipart upload.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to know, thanks!
a32f63e
to
2a17d35
Compare
eb150a2
to
8bd78d5
Compare
@irq0 are you satisfied with the changes? Anything else comes to mind? I'd love to merge this soon-ish :) |
I'll merge as soon as CI passes |
Implements new versioning design. Includes `rgw::sal::Attrs` type binding in `sqliteorm` code, so VersionedObject code for conversions is no longer needed. Adds transactions for the actions that require more than 1 database access. Simplifies the way a new version is created and moves its logic to a sqlite transaction to avoid race conditions when creating N objects with the same name at once from several threads. Fixes: https://github.com/aquarist-labs/s3gw/issues/378 Fixes: https://github.com/aquarist-labs/s3gw/issues/472 Fixes: https://github.com/aquarist-labs/s3gw/issues/547 Fixes: https://github.com/aquarist-labs/s3gw/issues/526 Fixes: https://github.com/aquarist-labs/s3gw/issues/524 Fixes: https://github.com/aquarist-labs/s3gw/issues/519 Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
8bd78d5
to
86792d9
Compare
After [versioning](aquarist-labs#153) was merged there are a few more s3 tests passing. This adds 3 Life cycle plus 1 bucket creation s3 test. Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
After [versioning](#153) was merged there are a few more s3 tests passing. This adds 3 Life cycle plus 1 bucket creation s3 test. Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
After [versioning](aquarist-labs#153) was merged there are a few more s3 tests passing. This adds 3 Life cycle plus 1 bucket creation s3 test. Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
After [versioning](#153) was merged there are a few more s3 tests passing. This adds 3 Life cycle plus 1 bucket creation s3 test. Signed-off-by: Xavi Garcia <xavi.garcia@suse.com>
Implements new versioning design following this ADR
Includes
rgw::sal::Attrs
type binding insqliteorm
code, so VersionedObject code for conversions is no longer needed.Any value that was a
BLOB
before and that it's not optional should be good to be bound.Just declare the type in the database struct and add this:
That file uses the previous code to convert
ceph
types usingbufferlist
("rgw/driver/sfs/sqlite/conversion_utils.h")Extra code for dealing with optional
BLOB
will be proposed in a future PR and we'll be able to delete all the conversionlayers where no strictly needed.
Adds transactions for the actions that require more than 1 database access.
Simplifies the way a new version is created and moves its logic to a sqlite transaction to avoid race conditions when creating N objects with the same name at once from several threads.
Also changed the name of the objects and versioned_objects table names to
DBObject
andDBVersionedObject
The following
s3 tests
now pass:Fixes: https://github.com/aquarist-labs/s3gw/issues/378
Fixes: https://github.com/aquarist-labs/s3gw/issues/472
Fixes: https://github.com/aquarist-labs/s3gw/issues/547
Fixes: https://github.com/aquarist-labs/s3gw/issues/526
Fixes: https://github.com/aquarist-labs/s3gw/issues/524
Fixes: https://github.com/aquarist-labs/s3gw/issues/519
Signed-off-by: Xavi Garcia xavi.garcia@suse.com
Checklist