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

NAS-131762 / 25.04 / Add private NFS method to clear rmtab or selected entries. #15276

Merged
merged 3 commits into from
Dec 31, 2024

Conversation

mgrimesix
Copy link
Contributor

@mgrimesix mgrimesix commented Dec 30, 2024

rmtab catch-22

NFSv3 uses rmtab to list the NFSv3 clients that have mounted a share. An entry is added when mountd successfully processes a client mount command. The client entries are removed only when the client unmounts the share via the umount command. If the client is powered off or stops using the share for any reason without first sending the umount command the rmtab entry for that client will remain. Forever. This results in the accumulation of many stale entries in rmtab. There is no 'optimal' solution to address this. Two possible options are to manually delete the known stale entries or clear rmtab on system boot. Manually clearing selected entries is successful only with apriori knowledge of which clients are not returning. Clearing rmtab on boot will clear stale entries and entries associated with active clients. The 'active' clients do not automatically repopulate rmtab.

NFSv4 does not have the same issue as it is a connection based protocol and maintains the NFSv4 client list in an active manner.

No CI test was created as it requires rebooting the server under test.
Manual failover testing found rmtab is not cleared (correct behavior).

With this change a reboot or middleware restart will clear rmtab.

Add helper bash script to be used in systemd NFS startup.
Add pre-start call to helper script in systemd NFS server override.
@mgrimesix mgrimesix added the WIP label Dec 30, 2024
@bugclerk bugclerk changed the title Add private NFS method to clear rmtab or selected entries. NAS-131762 / 25.04 / Add private NFS method to clear rmtab or selected entries. Dec 30, 2024
@bugclerk
Copy link
Contributor

@anodos325
Copy link
Contributor

We're trying to avoid adding more scripts where we call into private middleware methods. This should be part of middleware startup and not a systemd unit.

@mgrimesix mgrimesix removed the WIP label Dec 30, 2024
@mgrimesix mgrimesix requested a review from a team December 30, 2024 19:04
@mgrimesix mgrimesix added the WIP label Dec 30, 2024
Make call to clear rmtab from nfs.setup_directories.
Cannot use middleware setup hook because /var/db/system/nfs is not yet available at that point.
@mgrimesix mgrimesix removed the WIP label Dec 31, 2024
@mgrimesix mgrimesix requested a review from anodos325 December 31, 2024 03:23
@mgrimesix mgrimesix merged commit 42ab42a into master Dec 31, 2024
2 checks passed
@mgrimesix mgrimesix deleted the NAS-131762 branch December 31, 2024 21:26
@bugclerk
Copy link
Contributor

This PR has been merged and conversations have been locked.
If you would like to discuss more about this issue please use our forums or raise a Jira ticket.

@truenas truenas locked as resolved and limited conversation to collaborators Dec 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants