Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

rgw/sfs: update bucket stats #152

Merged
merged 1 commit into from
Oct 16, 2023
Merged

Conversation

jecluis
Copy link
Member

@jecluis jecluis commented Jun 3, 2023

By updating bucket stats we enable operations like HeadBucket to provide the custom body that RGW populates, which includes the number of objects on the bucket, and the bucket's size.

Fixes: aquarist-labs/s3gw-tools#196

Signed-off-by: Joao Eduardo Luis <[email protected]>

@jecluis jecluis added kind/enhancement Change that positively impacts existing code area/rgw-sfs RGW & SFS related labels Jun 3, 2023
@jecluis jecluis requested review from 0xavi0 and irq0 June 3, 2023 10:28
irq0
irq0 previously requested changes Jun 6, 2023
@@ -18,6 +18,11 @@

namespace rgw::sal::sfs::sqlite {

struct SQLiteBucketStats {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggestion: Move into SQLiteBuckets and remove the 'SQLiteBucket' prefix.

}

return true;
});
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could probably be one sql statement with storage.select()?
Does RGW call this a lot?

pseudo sql:

select 
count(object_id) as obj_count,
sum(size) as size,
from buckets, objects, versioned objects
where buckets.bucket_id = objects.bucket.id and objects.uuid = versioned_object.object_id
group by object_id

@github-actions github-actions bot added the needs-rebase Changes need a rebase label Jul 11, 2023
@github-actions
Copy link

This pull request can no longer be automatically merged: a rebase is needed and changes have to be manually resolved

@jhmarina jhmarina added this to the v0.19.0 milestone Jul 13, 2023
@jhmarina jhmarina modified the milestones: v0.19.0, v0.20.0 Aug 7, 2023
@jecluis jecluis requested a review from irq0 August 18, 2023 23:25
@github-actions github-actions bot removed the needs-rebase Changes need a rebase label Aug 18, 2023
inner_join<DBObject>(
on(is_equal(&DBObject::uuid, &DBVersionedObject::object_id))
),
where(is_equal(&DBObject::bucket_id, bucket_id))
Copy link
Member

@irq0 irq0 Aug 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This sums / counts deleted versions. Add a is_equal(COMMITTED) ?

@jhmarina jhmarina removed this from the v0.20.0 milestone Sep 4, 2023
@jecluis
Copy link
Member Author

jecluis commented Oct 13, 2023

@irq0 mind another go?

@jecluis jecluis requested a review from irq0 October 13, 2023 15:20
@irq0
Copy link
Member

irq0 commented Oct 16, 2023

LGTM

Looks like we pass 2 more s3 tests and qa/rgw/store/sfs/../fixtures/s3tr_excuses.csv needs two rows less 🥳

(Fix for the truncated output in the test results already in flight https://github.com/aquarist-labs/s3gw/pull/760)

@jecluis
Copy link
Member Author

jecluis commented Oct 16, 2023

LGTM

Looks like we pass 2 more s3 tests and qa/rgw/store/sfs/../fixtures/s3tr_excuses.csv needs two rows less 🥳

(Fix for the truncated output in the test results already in flight aquarist-labs/s3gw#760)

ack, I'll remove those. :)

Signed-off-by: Joao Eduardo Luis <[email protected]>
@jecluis
Copy link
Member Author

jecluis commented Oct 16, 2023

pushed with excuses removed, lets see how that goes

@jecluis
Copy link
Member Author

jecluis commented Oct 16, 2023

everything is green 🎉

@irq0 need a green check mark to merge this

@jecluis jecluis merged commit 0b7bce5 into aquarist-labs:s3gw Oct 16, 2023
5 checks passed
@jecluis jecluis deleted the wip-bucket-stats branch October 16, 2023 18:31
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/rgw-sfs RGW & SFS related kind/enhancement Change that positively impacts existing code
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

rgw/sfs: implement SFSBucket::update_container_stats
3 participants