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

Remove atime references to FilesystemStore #1584

Merged
merged 1 commit into from
Feb 14, 2025

Conversation

allada
Copy link
Collaborator

@allada allada commented Feb 9, 2025

FilesystemStore will no longer keep atime of files up-to-date. This
was an expensive operation, since every time any CAS/AC item was
touched, it'd update the atime, which caused a lot of sys calls.

While the system is running this PR has no effect, but when the
program is restarted, items are now inserted in order of atime then
mtime, but it relies on the filesystem to keep atime up-to-date.
This means that .has() calls do not "refresh" the atime on disk.


This change is Reviewable

Copy link
Collaborator Author

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 0 of 1 LGTMs obtained, and 0 of 35 files reviewed, and pending CI: Analyze (javascript-typescript), Analyze (python), Bazel Dev / macos-13, Bazel Dev / macos-14, Bazel Dev / ubuntu-24.04, Cargo Dev / macos-13, Cargo Dev / ubuntu-22.04, Coverage, Installation / macos-13, Installation / macos-14, Installation / ubuntu-22.04, Local / lre-cc / ubuntu-24.04, Local / lre-rs / macos-14, Local / lre-rs / ubuntu-24.04, NativeLink.com Cloud / Remote Cache / macos-14, NativeLink.com Cloud / Remote Cache / ubuntu-24.04, Publish image, Publish nativelink-worker-init, Publish nativelink-worker-lre-cc, Remote / lre-cc / large-ubuntu-22.04, Remote / lre-rs / large-ubuntu-22.04, Web Platform Deployment / ubuntu-24.04, asan / ubuntu-22.04, docker-compose-compiles-nativelink (22.04), integration-tests (22.04), macos-13, pre-commit-checks, ubuntu-20.04 / stable, ubuntu-22.04, ubuntu-22.04 / stable, vale, windows-2022 / stable, and 1 discussions need to be resolved (waiting on @aaronmondal)


a discussion (no related file):
+@aaronmondal

Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 7 of 8 files at r3, 28 of 28 files at r4, all commit messages.
Reviewable status: 1 of 1 LGTMs obtained, and all files reviewed, and 3 discussions need to be resolved


-- commits line 10 at r4:
nit: duplicate "atime then atime"


nativelink-store/src/filesystem_store.rs line 480 at r4 (raw file):

                    .accessed()
                    .or_else(|_| metadata.modified())
                    .unwrap_or(SystemTime::UNIX_EPOCH);

nit: Would this work on windows?

FilesystemStore will no longer keep atime of files up-to-date. This
was an expensive operation, since every time any CAS/AC item was
touched, it'd update the atime, which caused a lot of sys calls.

While the system is running this PR has no effect, but when the
program is restarted, items are now inserted in order of atime then
mtime, but it relies on the filesystem to keep atime up-to-date.
This means that .has() calls do not "refresh" the atime on disk.
Copy link
Collaborator Author

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained, and all files reviewed, and pending CI: pre-commit-checks, and 3 discussions need to be resolved


nativelink-store/src/filesystem_store.rs line 480 at r4 (raw file):

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

nit: Would this work on windows?

Yes, it should. We are using standard library stuff here and rust is pretty good at gating linux specific things behind a different include ext.

Copy link
Collaborator Author

@allada allada left a comment

Choose a reason for hiding this comment

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

Reviewable status: 1 of 1 LGTMs obtained, and all files reviewed, and pending CI: pre-commit-checks, and 1 discussions need to be resolved


-- commits line 10 at r4:

Previously, aaronmondal (Aaron Siddhartha Mondal) wrote…

nit: duplicate "atime then atime"

Done.

@allada allada enabled auto-merge (squash) February 13, 2025 23:27
Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Reviewed all commit messages.
Reviewable status: 1 of 1 LGTMs obtained, and all files reviewed, and 1 discussions need to be resolved

Copy link
Member

@aaronmondal aaronmondal left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 1 of 1 LGTMs obtained, and all files reviewed

@allada allada merged commit 0d6cbed into TraceMachina:main Feb 14, 2025
37 checks passed
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