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

Introduce negative metadata cache entries #696

Merged
merged 4 commits into from
Feb 7, 2024

Conversation

passaro
Copy link
Contributor

@passaro passaro commented Jan 10, 2024

Description of change

Reduce latency when repeatedly looking up non-existing files or directories (when cache is enabled).

This change adds negative metadata cache entries: whenever a lookup fails because an object does not exist, we cache a “negative” entry with the same TTL as for successful lookups and use it to reply to subsequent kernel requests for the same name.

The negative entries are maintained separately from the inode tree using the new NegativeCache type, which enforces an upper limit to the number of entries and handles their expiration.

Does this change impact existing behavior?

Repeated lookups for non-existing entries will not trigger S3 requests for the configured TTL.


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

@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 10, 2024 12:05 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:40 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:40 — with GitHub Actions Inactive
@passaro passaro had a problem deploying to PR integration tests January 15, 2024 10:40 — with GitHub Actions Failure
@passaro passaro had a problem deploying to PR integration tests January 15, 2024 10:40 — with GitHub Actions Failure
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:40 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:40 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:40 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 15, 2024 10:58 — with GitHub Actions Inactive
@passaro passaro had a problem deploying to PR integration tests January 16, 2024 16:21 — with GitHub Actions Failure
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests January 16, 2024 16:21 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 2, 2024 12:11 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:54 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:54 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:54 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:55 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 5, 2024 11:55 — with GitHub Actions Inactive
arsh
arsh previously approved these changes Feb 6, 2024
Copy link
Contributor

@arsh arsh left a comment

Choose a reason for hiding this comment

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

LGTM

Signed-off-by: Alessandro Passaro <[email protected]>
Reduce latency when repeatedly looking up non-existing files or directories (when cache is enabled).

This change adds negative metadata cache entries: whenever a lookup fails because an object does not exist, we cache a “negative” entry with the same TTL as for successful lookups and use it to reply to subsequent kernel requests for the same name.

The negative entries are maintained separately from the inode tree using the new `NegativeCache` type, which enforces an upper limit to the number of entries and handles their expiration.

Signed-off-by: Alessandro Passaro <[email protected]>
Signed-off-by: Alessandro Passaro <[email protected]>
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro temporarily deployed to PR integration tests February 6, 2024 18:39 — with GitHub Actions Inactive
@passaro passaro added this pull request to the merge queue Feb 7, 2024
Merged via the queue into awslabs:main with commit 53e22be Feb 7, 2024
24 checks passed
@passaro passaro deleted the negative-cache branch February 7, 2024 10:37
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.

6 participants