This repository has been archived by the owner on Jan 3, 2024. It is now read-only.
rgw/sfs: change db schema as described in ADR. #150
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes the db schema following this ADR.
It deletes repeated fields that we had in
objects
vsversioned_objects
tables and creates new fields in theversioned_objects
table.Logic of
sfs
was intentionally not updated in this PR. (For example new fieldversion_type
is added to the schema, but still not used).Updates in logic, specially in versioning logic, will come in a future PR.
New Features:
Sqliteorm type bindings for the following types.
uuid_d
ceph::real_time
rgw::sal::sfs::ObjetState
rgw::sal::sfs::VersionType
In general, any enum type that has a
LAST_VALUE
item assigned to the last valid value and that also starts with 0 is eligible to be binded to sqliteorm, as the type binding for enums is generic.For example: you can create an enum like:
and use it right away in sqliteorm.
Custom type bindings code are using exceptions because they are specialisations of
sqlite_orm
.Object has no explicit conversion code
As all the types in the
object
table are compatible withsqliteorm
we don't need extra conversion layer.This is a preview of what we can do with the rest of database objects once
BLOBS
are also type bound in the future.That was not done in this PR to avoid too many changes.
Note: The new type
VersionType
was added as a new fileversion_type.h
because we are in a re-design process and I wasn't sure if it should be located in any other existing file that might be eligible to be deleted in the near future.Fixes: https://github.com/aquarist-labs/s3gw/issues/480
Signed-off-by: Xavi Garcia xavi.garcia@suse.com
Checklist