LFS-DATA_VERSION(1)

NAME
lfs-data_version - display or update the stored file data version

SYNOPSIS
lfs data_version {--nosync|-n|--read|-r|--write|-w} [--set-hsm|-s] FILENAME

DESCRIPTION
Display the current version of file data for FILENAME, and optionally set the data version stored in the HSM xattr.

The data version is the sum of the last committed transaction numbers of all data objects of a file for write() (or similar data modification), truncate() (or similar size modification) RPC in which an object's file data was modified. It does not track metadata operations on the file such as file permissions, ownership, etc. There is no guarantee that one data version is ordered compared to another, and should only be used for equality or inequality comparison for a single FILENAME to check if its data objects were changed since the last data_version read.

The data version is typically used by data management engines such as HSM, OST object migration, and mirroring, primarily to verify that file data has not been changed concurrently by another process during a data movement or release operation.

Even when a cache flush is triggered on clients accessing this file using -r or -w, race conditions are possible and the data version should be checked before and after data management operations to ensure the data did not change concurrently.

OPTIONS

-n ,  --nosync
    Read the data version without taking any data lock to sync file data. The data version could be stale if cached pages exist on filesystem clients, but this option avoids data flush and has less of an impact on the filesystem.

-r ,  --read-lock
    Read the data version after getting a read lock on FILENAME to flush its dirty client pages on all clients.

-s ,  --set-hsm
    Read the data version from FILENAME (by default using a read lock) and write it to the trusted.hsm xattr.

-w ,  --write-lock
    Read the data version after getting a write lock on FILENAME to flush all of its cached data pages from all clients.

AVAILABILITY
The lfs data_version command is part of the lustre(7) filesystem package since release 2.3.0.

SEE ALSO
lfs(1), llapi_get_data_version(3), llapi_hsm_data_version_set(3), lustre(7)