﻿# An old Lustre archive copy cannot qualify a dirty file for release

HSM archive existence and current content are different facts. Inspect dirty, archived and released state before reclaiming Lustre's resident data.

Author: Retrivium team
Updated: 2026-11-06
Canonical URL: https://retrivium.ai/journal/lustre-hsm-dirty-archive-release-boundary/
Language: en

## Reclaiming space can select the wrong generation

A checkpoint file was archived and then updated in place. An inventory still finds an archive copy, so a cleanup policy proposes releasing resident Lustre data. The existence of the older copy does not demonstrate that the current file can be recovered after its local data is released.

The [HSM state manual](https://raw.githubusercontent.com/lustre/lustre-release/master/Documentation/man1/lfs-hsm.1) distinguishes archive existence, an up-to-date archive and content that is no longer synchronized with the backend. Treat freshness as a separate prerequisite instead of collapsing those states into a single archived label.

## Read the whole state combination

Capture the file identity, archive identifier, state flags and any in-progress HSM action. Dirty indicates that file contents are not synchronized with the backend and should be archived again. Lost describes a backend copy that is no longer usable. Neither state qualifies the current contents as a verified recovery source.

The [metadata-server implementation](https://raw.githubusercontent.com/lustre/lustre-release/master/lustre/mdt/mdt_hsm.c) rejects inconsistent flag combinations, including dirty together with released and released without archived. This inspected source is evidence of a state invariant, not evidence that an operator has tested the backend or successfully restored a particular file.

## Separate request from durable archive

An archive request and an in-progress action are not completion evidence. Preserve the relevant action outcome and resulting state for the intended file version. A writer that continues updating the file can invalidate a freshness observation taken earlier in the cleanup process.

Bound the publication first: identify a completed checkpoint generation and prevent further in-place mutation while qualifying it. If that boundary cannot be established, defer release rather than treating a pathname as an immutable version identifier. File size and modification time alone are weak substitutes for application identity.

## Do not repair evidence by editing flags

The manual exposes operations that change HSM flags, but changing a label does not copy current bytes into the archive. Clearing dirty or asserting archived without the corresponding data operation can make metadata appear satisfactory while leaving the recovery source wrong.

Use the supported archive workflow and preserve its outcomes. Keep backend identity and availability evidence with the file state. A policy engine should distinguish an unavailable archive service from a resident file that is genuinely safe to release.

## Acceptance before reclaiming resident data

Accept the release candidate only after the intended checkpoint state has a completed current archive and a defined restore path. A controlled restore of a disposable representative file can validate the integration without risking the only retained checkpoint. Record exactly which generation was checked and what remains unverified.

[Recovery-tier selection](/journal/google-multi-tier-checkpoints-failure-domains-restore-overrides/) explains why an older near copy cannot silently override the intended checkpoint. [Snapshot consistency](/journal/guide-storage-filesystem-snapshot/) explains the additional application-level boundary across multiple checkpoint files.

## Limits of HSM state evidence

Correct flags do not prove backend media integrity, independent failure domains or consistency across an entire training checkpoint. Releasing resident data also does not mean deleting the file's namespace entry or removing the archive. The accepted claim is specific: the current file state has a qualified archive before local data reclamation, with no invented restore result or conflation of archive presence and freshness.
