Skip to content

Commit

Permalink
rgw/sfs: Implement new versioning design
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
0xavi0 committed Jun 7, 2023
1 parent 3db8861 commit 2ff1d10
Show file tree
Hide file tree
Showing 31 changed files with 5,425 additions and 4,253 deletions.
18 changes: 5 additions & 13 deletions qa/rgw/store/sfs/tests/test-sfs-lifecycle-smoke.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,17 +130,13 @@ def test_expiration(self):
{
"ID": "rule1",
"Expiration": {"Days": 1},
"Filter": {
"Prefix": "expire1/"
},
"Filter": {"Prefix": "expire1/"},
"Status": "Enabled",
},
{
"ID": "rule2",
"Expiration": {"Days": 5},
"Filter": {
"Prefix": "expire3/"
},
"Filter": {"Prefix": "expire3/"},
"Status": "Enabled",
},
]
Expand Down Expand Up @@ -200,9 +196,7 @@ def test_lifecycle_versioning_enabled(self):
{
"ID": "rule1",
"Expiration": {"Days": 1},
"Filter": {
"Prefix": "expire1/"
},
"Filter": {"Prefix": "expire1/"},
"Status": "Enabled",
}
]
Expand All @@ -212,7 +206,7 @@ def test_lifecycle_versioning_enabled(self):
)

# give enough time to expire.
# 4 cycles because:
# 3 cycles because:
# 1st cycle won't be expired yet (not still 1 day)
# 2nd cycle rgw considers the bucket at processed
# today and skips it
Expand All @@ -238,9 +232,7 @@ def test_expiration_multiple_buckets(self):
{
"ID": "rule1",
"Expiration": {"Days": 1},
"Filter": {
"Prefix": "expire1/"
},
"Filter": {"Prefix": "expire1/"},
"Status": "Enabled",
}
]
Expand Down
1 change: 1 addition & 0 deletions qa/rgw/store/sfs/tests/test-sfs-object-locking.py
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,7 @@ def test_object_locking_legal_hold(self):

self.assertTrue(response["ResponseMetadata"]["HTTPStatusCode"] == 204)


if __name__ == "__main__":
if len(sys.argv) == 2:
address_port = sys.argv.pop()
Expand Down
Loading

0 comments on commit 2ff1d10

Please sign in to comment.