Enable global file locking


Beginning with ONTAP 9.10.1, global file locking can be applied to prevent reads across all related cached files.

By default, FlexCache volumes favor availability over consistency. Without global file lock, any modification to an origin will be distributed to FlexCache volumes, but they may not updated simultaneously. Global file locking favors consistency across volumes over availability. With global file locking enabled, modifications to the origin will be suspended until all FlexCache volumes are online.

Note You should only enable global file locking when you have control over the reliability of the connections between cache and origin due to suspension and possible timeouts of modifications when FlexCache volumes are offline.

Global file locking requires the clusters containing the origin and all associated caches to be running ONTAP 9.9 or higher. Global file locking can be enabled on new or existing FlexCache volumes. The command can be run on one volume and will apply to all associated volumes. You must be in the advanced privilege level to enable global file locking.

The process to enable global file lock depends on whether the origin has existing caches.

Procedure to enable global file locking on new FlexCache volumes:
  1. Create the FlexCache volume with -is-global-file-locking set to true:

    volume flexcache create volume volume_name -is-global-file-locking-enabled true

    The default value of -is-global-file-locking is false. When running any subsequent volume flexcache create commands run on a volume, they must be passed with -is-global-file-locking enabled set to true.

Procedure to enable global file locking on existing FlexCache volumes
  1. Global file locking must be set from the origin volume.

  2. The origin cannot have any other existing relationships (for example, SnapMirror). Any existing relationships must be dissociated. All caches and volumes must be connected at the time of running the command. To check the connection status, run:

    volume flexcache connection-status show

    The status for all the listed volumes should display as “connected.” For more information, see Viewing the status of a FlexCache relationship or Synchronizing properties of a FlexCache volume from an origin.

  3. Enable global file locking on the caches:

    volume flexcache origin config show/modify -volume volume_name -is-global-file-locking-enabled true

If reverting to a version of ONTAP before 9.9, global file lock must first be disabled on the origin and associated caches. This can be managed by running: volume flexcache prepare-to-downgrade -disable-feature-set 9.10.0