Skip to content
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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

c-hagem
Copy link
Contributor

@c-hagem c-hagem commented Jan 30, 2025

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).

@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:10 — with GitHub Actions Waiting
@c-hagem c-hagem force-pushed the invalidate-negative-cache branch from 740d632 to db09a8b Compare January 30, 2025 12:11
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 12:11 — with GitHub Actions Waiting
@muddyfish
Copy link
Contributor

I think it probably does want a changelog entry but under the 'other changes' list

Signed-off-by: Christian Hagemeier <chagem@amazon.com>
@c-hagem c-hagem force-pushed the invalidate-negative-cache branch from db09a8b to 31ec9b9 Compare January 30, 2025 17:34
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
@c-hagem c-hagem requested a deployment to PR integration tests January 30, 2025 17:34 — with GitHub Actions Waiting
Copy link
Contributor

@passaro passaro left a 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.
Copy link
Contributor

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:

Suggested change
* 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))

Copy link
Contributor

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);
Copy link
Contributor

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.

@passaro
Copy link
Contributor

passaro commented Jan 31, 2025

nit: I'd use "purge" rather than "expel" in the PR/changelog/comments

@c-hagem c-hagem changed the title Expel file from the negative cache on create Purge file from the negative cache on create Jan 31, 2025
@c-hagem
Copy link
Contributor Author

c-hagem commented Jan 31, 2025

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants