GoogleCloudPlatform / GoogleCloudPlatform/gcsfuse

File cache is not persistent across remounts

Open
#2,137 1 comment 2 reactions 0 assignees View on GitHub
doc feature request p1 question
Dominant language
Go
Stars
2.3k
Forks
510
Avg merge
2d 17h
Merged PRs (30d)
35

Description

**Describe the issue**

When GCSFuse unmounts and remounts, the file cache populated doesn't seem to be accessed.

n https://cloud.google.com/storage/docs/gcsfuse-cache#persistence says that the file cache should be reused when the metadata cache has been populated, but it doesn't seem to be the case.

A brief grep through the codebase suggests that contentcache have the code that handles persistence of the cache, but this functionality is not present in the filecache code. The contentcache seems completely unused currently so the functionality is lost.

**Reproduction**

The following experiment is conducted:
* Have a 1.7G file on a GCS bucket
* Mount with the following options `gcsfuse -o ro --file-mode=755 --config-file=gcs.yaml BUCKET_NAME /mnt` with the config file below:
```yaml
file-cache:
max-size-mb: -1
cache-file-for-range-read: true
metadata-cache:
stat-cache-max-size-mb: 32
ttl-secs: 3600
type-cache-max-size-mb: 4
cache-dir: ~/.cache/gcsfuse
```
* `vmtouch -t /mnt/large_file` takes ~18 seconds.
* Subsequent vmtouch calls are also instant to complete.
* `umount /mnt` and remount.
* `vmtouch -t /mnt/large_file` still takes ~18 seconds.

**System (please complete the following information):**
- OS: NixOS 24.05
- Platform: Bare-metal
- Version: 2.3.1

**Additional context**
Add any other context about the problem here.

**SLO:**
We strive to respond to all bug reports within 24 business hours.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.