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-128399 / 24.10 / More nfs failover fixes #13598

Merged
merged 15 commits into from Apr 26, 2024
Merged

Conversation

mgrimesix
Copy link
Contributor

Problem

NFS was not configured to properly support HA function. NFS holds client state information in a database that, by default, is located at /var/lib/nfs. To properly support failover we need that to be a shared directory. For TrueNAS that is the system dataset.

Fix

Create and NFS entry in the system dataset. Generate the necessary directory structure and to support upgrade we also initialize it with data from /var/lib/nfs.
In systemd we bind the NFS client tracking daemon to nfs-server to allow the transfer of the client tracking database.
Update the nfs configuration file with the path to the nfs data on the system dataset: /var/db/system/nfs

Other related items in the PR

  1. Updated the CI tests
  2. Minor flake8 cleanup and refactoring

Fix flake8 complaint.
Improve error reporting for service state check.
…about 5 sec to start.

Added check for NFS dataset in first boot check in test_001_ssh.py.
Some simple refactoring in test_300_nfs.py.
@mgrimesix mgrimesix added the jira label Apr 18, 2024
@mgrimesix mgrimesix requested a review from a team April 18, 2024 22:38
@bugclerk bugclerk changed the title More nfs failover fixes NAS-128399 / 24.10 / More nfs failover fixes Apr 18, 2024
@bugclerk
Copy link
Contributor

@truenas truenas deleted a comment from bugclerk Apr 19, 2024
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
@mgrimesix mgrimesix requested a review from yocalebo April 22, 2024 19:58
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Just a few remaining items 👍

src/middlewared/middlewared/plugins/nfs.py Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
src/middlewared/middlewared/plugins/nfs.py Outdated Show resolved Hide resolved
* Rename class NFSPath to NFSServicePathInfo and fixup usage in status.py and local.conf.mako
* Move improved name_to_id_conversion to standalone private method
* Update NFS state directory initialization
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

Fantastic, great job! Glad to see this general issue get resolved, finally. Be sure and wait for @anodos325 before merge 👍

@mgrimesix mgrimesix requested a review from yocalebo April 26, 2024 14:21
Copy link
Contributor

@yocalebo yocalebo left a comment

Choose a reason for hiding this comment

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

nice!

@mgrimesix mgrimesix merged commit 91bc180 into master Apr 26, 2024
2 checks passed
@mgrimesix mgrimesix deleted the more_nfs_failover_fixes branch April 26, 2024 20:18
@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 Apr 26, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
4 participants