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

Add request count tests for FS operations with metadata caching enabled #567

Merged
merged 8 commits into from
Oct 25, 2023

Conversation

dannycjones
Copy link
Contributor

Description of change

When adding metadata caching, we not only want to ensure that cached data is served but also verify we aren't still making S3 requests and the repeated S3 requests are truly eliminated.

This adds counter functionality to the mock client in mountpoint-s3-client, and adds a few tests covering the cached cases. We may also want to add more assertions to existing tests or test the cases with caching turned off.

Relevant issues: #255

Does this change impact existing behavior?

No change, tests only.


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

@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 09:51 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 09:51 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 09:51 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 09:51 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 10:34 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 10:34 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 10:34 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 10:34 — with GitHub Actions Inactive
Signed-off-by: Daniel Carl Jones <[email protected]>
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 11:53 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 11:53 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 11:53 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 20, 2023 11:53 — with GitHub Actions Inactive
Copy link
Member

@jamesbornholt jamesbornholt left a comment

Choose a reason for hiding this comment

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

neat!

mountpoint-s3-client/src/mock_client.rs Outdated Show resolved Hide resolved
mountpoint-s3/tests/fs.rs Outdated Show resolved Hide resolved
Comment on lines +240 to +241
assert_eq!(head_counter.count(), 1);
assert_eq!(list_counter.count(), 1);
Copy link
Member

Choose a reason for hiding this comment

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

to the previous comment, this surprised me until I understood what prefer_s3 meant

Copy link
Member

Choose a reason for hiding this comment

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

probably also worth an uncached version of this test that confirms we do the requests again on open

Copy link
Contributor Author

Choose a reason for hiding this comment

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

agree! I'm wondering whether it is enough to find a way to run existing tests with and without caching: if they pass, then it must have gone to S3.

that being said, maybe it's nice to codify the number of requests we expect.

still thinking here.

Copy link
Member

Choose a reason for hiding this comment

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

We don't want to go too overboard with hard-coding the exact request counts for all these scenarios in the uncached case, but one uncached test would be helpful.

Copy link
Contributor Author

@dannycjones dannycjones Oct 25, 2023

Choose a reason for hiding this comment

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

Added a case here for lookup only test_lookup_then_open_no_cache

@dannycjones dannycjones temporarily deployed to PR integration tests October 25, 2023 11:05 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 25, 2023 11:05 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 25, 2023 11:05 — with GitHub Actions Inactive
@dannycjones dannycjones temporarily deployed to PR integration tests October 25, 2023 11:05 — with GitHub Actions Inactive
@dannycjones dannycjones marked this pull request as ready for review October 25, 2023 11:06
@jamesbornholt jamesbornholt added this pull request to the merge queue Oct 25, 2023
Merged via the queue into awslabs:main with commit fa0d516 Oct 25, 2023
@dannycjones dannycjones deleted the metadata-cache-testing branch October 25, 2023 21:38
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.

2 participants