Max Share Size Enforcement
Max Share Size is a soft limit on the amount of data in a share. Hammerspace enforces the limit after the fact: it refuses new writes once it has recorded that the share holds more data than the limit allows. Because of this, the amount of data in a share can exceed its Max Share Size.
This section describes how the limit is detected, what NFS and SMB clients see when a share is full, and how to plan for it. To set the limit, see Creating a Share.
|
The GUI calls this setting Max Share Size. The Admin CLI and the system events call the same setting the share quota: the |
Max Share Size is separate from the capacity of the storage volumes behind the share. A share can run out of storage capacity before it reaches its Max Share Size. See Capacity Management.
How the Share Size Limit Is Detected
Clients read and write file data directly on the storage volumes. The data does not pass through the Anvil, the metadata server that manages the share. For this reason, Hammerspace cannot count each write against the limit as it happens. Instead, it keeps a record of the space each share has used, updates that record as usage is reported, and compares the recorded usage with Max Share Size.
When the recorded usage is greater than Max Share Size, Hammerspace treats the share as full and does the following:
-
Asks NFS clients that hold permission to write directly to storage (a pNFS write layout) for files in the share to return that permission. The request is advisory. A client that is already writing a file is not forced to stop.
-
Refuses new requests to write to files in the share. What the client sees depends on the protocol, as the following sections describe.
Requests to read files in a full share are not refused.
Because the limit is checked against recorded usage, the share can already be over its limit by the time new writes are refused.
The share accepts new writes again when its recorded usage is no longer greater than its Max Share Size, either because data was removed or because the limit was raised or cleared.
NFS Clients on a Full Share
When a share is full, Hammerspace reports the condition to NFS clients as a no-space error. An application on a Linux client sees No space left on device (ENOSPC). Hammerspace does not return a quota-exceeded error (EDQUOT) for Max Share Size.
NFSv4.2 Clients
An NFSv4.2 client writes to storage directly, using a write layout that it requests from the Anvil. On a full share:
-
A request for a new write layout is refused with the no-space error. Opening a file for writing is not refused by itself. The error is returned when the client requests the layout it needs to write.
-
A request for a read layout is not refused, so files in the share can still be read.
-
A client that already holds a write layout for a file is asked to return it, but is not forced to. Such a client can continue to write to that file.
-
Creating a new file can leave an empty file behind. The file name is created before the write is refused.
NFSv3 Clients
NFSv3 clients receive the same no-space error. An NFSv3 client usually learns of the error when it sends a write that must be committed to storage immediately, or when it commits a series of earlier writes. The application sees the error from a synchronous write, or when it calls fsync().
SMB Clients on a Full Share
In Hammerspace 5.2 and 5.3, Max Share Size does not stop an SMB client from creating new files in a full share. SMB clients can continue to create and write new files, so the amount of data in the share keeps growing past the limit.
| Do not rely on Max Share Size to cap the amount of data that SMB clients store in a share. Set an Alert Threshold and act on the share-capacity events before the share reaches its limit. |
Best Practices for Max Share Size
-
Treat Max Share Size as a soft limit. If the data in a share must never exceed a fixed amount, set the limit below that amount to leave room for data written before the limit is enforced.
-
Set an Alert Threshold when you set a Max Share Size, so that a
SHARE_QUOTA_WARNINGevent is raised while there is still room to act. See Configuring Share-Capacity Notifications. -
Send share-capacity events to the people who can act on them. A
SHARE_QUOTA_EXCEEDEDevent means that the share has reached its limit and that NFS clients are being refused new writes, or soon will be. -
When a share reaches its limit, remove data from the share or raise the limit. To change the limit, edit the share in the GUI, or use the
--sizeoption of theshare-updatecommand. To remove the limit, use--size-clear. -
For shares used by SMB clients, keep usage below the limit. SMB clients are not stopped at the limit in the same way as NFS clients. See SMB Clients on a Full Share.