-
Notifications
You must be signed in to change notification settings - Fork 5
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
Fix global prefix not working with update marker #42
Conversation
Thank you for the detailed report! I created #44 to track this memory issue. I think I have found a culprit, that is related to GetObject operations, which matches the metrics you provided. |
@ahouene Seems to work: |
backends/s3/s3.go
Outdated
defer func() { | ||
if !b.hasGlobalPrefix() { | ||
return | ||
} | ||
for i, blob := range blobList { | ||
s, _ := b.cutGlobalPrefix(blob.Name) | ||
blobList[i].Name = s | ||
} | ||
}() |
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.
If I read this correctly, by putting all of this in a defer, you are changing the cached values and calling it over and over on existing cached values.
Don't do magic in defer
, it will bite you.
72dcdd8
to
1b35697
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.
Great, a lot clearer now!
When using both the update marker and the global prefix options, the marker would be written without the global prefix, and we'd try to read it with the global prefix.
This PR makes sure the global prefix is always used with the update marker.
Closes #40