Update the secondary group cache (#1492)
Some checks are pending
CodeQL / Analyze (push) Waiting to run
mkdocs / deploy (push) Waiting to run

* Use concurrent_flat_map to build a global cache rather than per
thread.
* Create global maintanence thread manager for clearing unused cache
entries.
This commit is contained in:
trapexit 2025-07-05 17:05:53 -05:00 • committed by GitHub
parent 9e626228be
commit f852474073
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
17 changed files with 342 additions and 246 deletions

View file

@ -8,7 +8,7 @@ background](../intro_to_filesystems.md) in such things is recommended
for more advanced configurations.
These option names and values are the same regardless of whether you
use them with the `mergerfs` commandline program, in fstab, or in a
use them with the `mergerfs` command line program, in fstab, or in a
config file.
@ -204,6 +204,12 @@ config file.
* **[passthrough](passthrough.md)**: Enable [FUSE IO
passthrough](https://kernelnewbies.org/Linux_6.9#Faster_FUSE_I.2FO)
if available. (default: off)
* **gid-cache-expire-timeout**: Number of seconds till supplemental
group data is refreshed in the [GID
cache](../known_issues_bugs.md#supplemental-user-groups). (default:
3600)
* **gid-cache-remove-timeout**: Number of seconds to wait till cached
data is removed due to lack of usage. (default: 43200)
**NOTE:** Options are evaluated in the order listed so if the options
are **func.rmdir=rand,category.action=ff** the **action** category

View file

@ -4,25 +4,26 @@
### Supplemental user groups
#### Supplemental group caching
Due to the overhead of
[getgroups/setgroups](http://linux.die.net/man/2/setgroups) mergerfs
utilizes a cache. This cache is opportunistic and per thread. Each
thread will query the supplemental groups for a user when that
particular thread needs to change credentials and will keep that data
for the lifetime of the thread. This means that if a user is added to
a group it may not be picked up without the restart of
mergerfs. In the future this may be improved to allow a periodic or
manual clearing of the cache.
utilizes a cache. As necessary the supplemental group information will
be queried and cached. That cached list of groups will be used to set
the supplement groups as necessary. Due to the high cost of querying
the group list the default expiry for said data is 1 hour and after 12
hours of no usage will be removed from the cache all together.
#### Host vs Container identity
While not a bug some users have found when using containers that
supplemental groups defined inside the container don't work as
expected. Since mergerfs lives outside the container it is querying
the host's group database. Effectively containers have their own user
and group definitions unless setup otherwise just as different systems
would.
the host's group database. Containers have their own user and group
definitions unless setup otherwise just as different systems would.
Users should mount in the host group file into the containers or use a
standard shared user & groups technology like NIS or LDAP.
standard shared user and groups technology like NIS or LDAP.
### directory mtime is not being updated