NFSv4 File Delegations

Prev Next

The VAST NFSv4 server can optionally grant a read or write delegation to the client opening a file.

  • If the server grants a read delegation, the client can cache the data and read from the cache, while the server assures that no other client can write to the file for the duration of the delegation.

  • If the server grants a write delegation, the client can cache data and metadata, and perform both read and write operations on it, while the server assures that no other client can write to the file or read from it for the duration of the delegation.

Read delegations for a file can be granted to multiple clients at the same time. A write delegation can be granted to a single client only.

A delegation can be recalled or revoked in case of a conflict. For example, opening a file for a read operation results in recall of an existing write delegation.

Use of file delegations may significantly reduce the amount of client-server communication for the files being delegated, boosting VAST cluster performance for specific types of workloads, such as running SQLite over NFS, compilation tasks, or extracting data from very large ZIP or TAR archives.

Requirements and Limitations

The following requirements and limitations apply when using NFSv4 file delegations:

  • The NFSv4 protocol requires Network Time Protocol (NTP) to be configured on both the VAST cluster and the client. While VAST does not enforce this requirement, the absence of proper time synchronization may, in rare cases, result in unexpected behavior.

  • The client must establish an NFSv4 backchannel connection.

  • NFSv4 delegations are not supported with RDMA.

  • Using NFSv4 file delegations on views for which other protocols are enabled, may result in unexpected behavior.

  • Restoring a snapshot on a tenant that has NFSv4 delegations enabled, may cause unexpected behavior with regard to delegated files. It is recommended to revoke existing delegations before restoring a snapshot.

  • SUSE Linux Enterprise Server 12.x and CentOS 7.x clients are not supported with NFSv4 delegations enabled.

  • NFSv4 delegations require mounting the client at least as NFS version 4.1. It is recommended to mount as NFS version 4.2 for additional performance improvements. Linux kernels 6.11+ on a client provide more performance advantages (RFC9754), which get backported to older kernels through VAST-NFS.

  • If you are using VAST-NFS, note that NFSv4 delegations are supported with VAST-NFS 4.0.32 and later. VAST-NFS 4.5 includes enhancements related to support of NFSv4 delegations.

Enabling and Disabling NFSv4 File Delegations

On newly deployed clusters, NFSv4 file delegations are enabled by default for both read and write operations.

NFSv4 file delegations can be enabled or disabled per tenant:

  • In VAST Web UI, use the Enable read delegations and Enable write delegations toggles in tenant settings (Element Store -> Tenants -> choose to create or edit a tenant -> Advanced Protocol Settings tag).

  • In VAST CLI, run the tenant create or tenant modify command and specify the type of delegations you need (read, write, read and write, or none) on the --allowed-delegations option.

By default, the cluster grants allowed delegations even when the client does not explicitly request a delegation. (This is useful for older Linux clients that do not ask for delegations but take advantage of them if granted by the server.) You can disable this behavior as follows:

  • In VAST Web UI, toggle off the Enable Unrequested NFSv4 File Delegations by Default option in tenant settings (Element Store -> Tenants -> choose to create or edit a tenant -> Advanced Protocol Settings tab -> NFS settings pane).

  • In VAST CLI, run the  tenant create or tenant modify command with the --disable-grant-unrequested-delegations-by-default option specified.

Listing Granted NFSv4 File Delegations

You can list NFSv4 file delegations that are currently in effect for a particular file path on a specific tenant:

  • In VAST Web UI, go to Element Store -> Views, right-click the view and select File Byte-range locks, file handles and file delegations. In the dialog that opens, enter the path to search for NFSv4 file delegations for the path you want. The delegations will be displayed in the grid.

  • In VAST CLI, run the  tenant nfs4-delegs-list command.

Recalling and Revoking NFSv4 File Delegations

A file delegation is recalled when the server receives a conflicting request for the same file, for example, a request to read from a file that is currently opened for writing, or a request to write to a file being read. The client needs to flush the cached data and return the delegation.

If a client does not return the delegation in response to a recall request within a reasonable timeframe, the server can decide to revoke its delegation.

You can revoke a specific delegation manually:

  • In VAST Web UI, go to Element Store -> Views, right-click the view and select File Byte-range locks, file handles and file delegations. In the dialog that opens, enter the path to search for NFSv4 file delegations for the path you want. In the grid with the search results, right-click the delegation you want to revoke and select Revoke.

  • In VAST CLI, run the  tenant nfs4-delegs-remove command.