-
Notifications
You must be signed in to change notification settings - Fork 182
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
Purge file from the negative cache on create #1250
base: main
Are you sure you want to change the base?
Conversation
740d632
to
db09a8b
Compare
I think it probably does want a changelog entry but under the 'other changes' list |
Signed-off-by: Christian Hagemeier <chagem@amazon.com>
db09a8b
to
31ec9b9
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.
Could you add a test reproducing the issue?
@@ -2,6 +2,9 @@ | |||
|
|||
* Add support for appending to objects originally uploaded with a CRC64-NVME checksum. ([#1235](https://github.com/awslabs/mountpoint-s3/pull/1235)) | |||
|
|||
### Other Changes | |||
* Fix an issue where file names were not expelled from negative cache. |
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.
We should include a link to this PR, like in the other entries:
* Fix an issue where file names were not expelled from negative cache. | |
* Fix an issue where file names were not expelled from negative cache. ([#1250](https://github.com/awslabs/mountpoint-s3/pull/1250)) |
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.
Also:
- why "file names"? Doesn't it apply to directories as well?
- we should qualify when the issue occurs.
@@ -367,6 +367,8 @@ impl Superblock { | |||
let inode = self | |||
.inner | |||
.create_inode_locked(&parent_inode, &mut parent_state, name, kind, state, true)?; | |||
// Expel inode from negative cache, if it is present | |||
self.inner.negative_cache.remove(parent_inode.ino(), name); |
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.
Should we consider updating the cache in create_inode_locked
? It would require changes to the update_from_remote
code path, but it could be a better trade off.
nit: I'd use "purge" rather than "expel" in the PR/changelog/comments |
Regarding tests, I was not able to reproduce this issue easily as a Rust test -- I tried to re-create the Python script I used in Rust, however that test worked as expected. |
This change adds code to remove entries from the negative cache once the new file is created.
Does not need a changelog entry, as it's only a small bugfix.
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).