-
Notifications
You must be signed in to change notification settings - Fork 197
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove prefix from inodes #1303
Conversation
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. So we're storing the prefix in the Superblock, the remaining part in the Inode and constructing the full key shortly before making a request to S3.
Some small suggestions from me, but fine with shipping after benchmarks finish (just in case).
@@ -34,7 +35,8 @@ struct InodeInner { | |||
parent: InodeNo, | |||
name: String, | |||
// TODO deduplicate keys by string interning or something -- many keys will have common prefixes | |||
full_key: String, | |||
/// Object key not including the prefix. |
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.
/// Object key not including the prefix. | |
/// Object key not including the prefix used to mount the bucket. May contain '/'. |
mountpoint-s3/src/superblock.rs
Outdated
@@ -988,7 +995,7 @@ impl SuperblockInner { | |||
|
|||
let next_ino = self.next_ino.fetch_add(1, Ordering::SeqCst); | |||
|
|||
let mut full_key = parent.full_key().to_owned(); | |||
let mut full_key = parent.key().to_owned(); |
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.
not really a full_key
now
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
Signed-off-by: Alessandro Passaro <alexpax@amazon.co.uk>
When Mountpoint is configured with the
--prefix
flag, all S3 requests contain the specified prefix as part of the key. Currently, the prefix is duplicated in eachInode
entry in thefull_key
field. This change remove the unnecessary duplication by only storing the partialkey
and reconstructing thefull_key
by adding the prefix before performing any S3 request.Does this change impact existing behavior?
No.
Does this change need a changelog entry? Does it require a version change?
mountpoint-s3
changelog entry. No version change.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and I agree to the terms of the Developer Certificate of Origin (DCO).