-
Technical task
-
Resolution: Unresolved
-
Medium
-
None
-
None
-
None
-
3
-
9223372036854775807
LFU's two scanners enumerate what exists: a namespace walk (LU-20603) and a
target scan (LU-20606, LU-20613). A changelog enumerates what happened.
Delivering it in the same struct llapi_scan_rec means a consumer written
against either can be fed by a delta without being rewritten.
This is the library half only.
lfs find --since and lfs find --changelog are a separate change.
The interface
New lustre/utils/liblustreapi_scan_changelog.c, one exported call:
int llapi_scan_changelog(const struct llapi_scan_changelog_param *sc, llapi_scan_cb_t cb, void *data); LLAPI_SCAN_CL_F_FOLLOW /* wait at the end of the log */ LLAPI_SCAN_CL_F_COALESCE /* one record per object, not per event */ LLAPI_SCAN_CL_F_RESOLVE /* fill what the log lacks */ LLAPI_SCAN_CL_F_CLEAR /* destructive; off by default */
The parameter block is versioned by sc_size like the other scanners', and
names the MDT, the registered user, a record range, a type mask and a demand
mask.
What it answers for
A record carries the FID, the parent FID, the name, the event and its time,
and, where the server recorded them, the uid and gid. Size, mode, times,
layout and HSM state are not in a changelog at any setting, so they arrive
absent with their sr_valid bit clear rather than as zeroes.
LLAPI_SCAN_CL_F_RESOLVE fills them through a client mount, one open and
one stat each, and the demand mask decides whether that happens at all.
Resolution fills what the stream lacks and never restates what it has, so a
caller can ask what an event recorded rather than what is true now.
The record gains sr_event_type, _flags, _time, _index and
_prev, the rename source and a job id, behind three new validity bits. An
event time is not an object time, so it does not land in sr_mtime.
Object mode holds events in a FID-keyed cache and delivers one record per
object once it has been quiet, so a file written a hundred times is one record
and one lookup rather than a hundred of each.
Clearing is off by default and never runs ahead of the callback: it is
irreversible and purges the registered user's whole backlog, not this reader's
alone. Registering that user stays the caller's, since registering without
consuming is how an MDT fills up.