LLAPI_CHANGELOG_CLEAR(3)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LLAPI_CHANGELOG_CLEAR πŸ’–

okay bestie, this is the llapi_changelog_clear page from section 3 of the Lustre Library Functions manual β€” yes, the library functions one, not the commands one, iykyk πŸ¦‹


✨ NAME ✨

llapi_changelog_clear β€” clear changelog records for a changelog consumer

like, it's the little guy that goes "okay this consumer is done with these records, you can let 'em go" πŸ’…


🌸 SYNOPSIS 🌸

#include <lustre/lustreapi.h>

int llapi_changelog_clear(const char *mdtname, const char *idstr,
                          long long endrec);

πŸŽ€ DESCRIPTION πŸŽ€

so llapi_changelog_clear() is basically telling the MDT: hey, every changelog record before endrec? not interesting to this particular consumer anymore. That consumer is identified by idstr. πŸ‘‘

and because you said that, the MDT mdtname (think something like "lustrefs-MDT0000") might be able to free up disk space by dropping those old records β€” but only if no other changelog consumers still need to process them. it's giving "sharing is caring" energy fr fr 🫢

if endrec is 0, that means the current last record. slay.

⚠️ heads up: changelog consumers have to be registered on the MDT node first, using this exact line: bash lctl --device MDT_NAME changelog_register no registration, no vibes. 😭

πŸ”₯ RETURN VALUES πŸ”₯

it returns the file descriptor on success β€” iconic β€” or a negative errno value on failure. πŸ’€


πŸ’œ ERRORS πŸ’œ

  • -EINVAL β€” one or more of the arguments you handed over are invalid. not the move bestie πŸ™ˆ
  • -ENOENT β€” the MDT's changelog char device wasn't found, or the changelog user wasn't found. it's literally not there.
  • -ENOPERM β€” not enough permissions to open the changelog char device. by default, that device is only accessible to the root user. πŸ‘‘ (yes, only root. root stays winning.)

🌈 EXAMPLE 🌈

say you wanna clear the changelog for one specific consumer ID β€” here's the whole vibe:

char *mdtname = "testfs-MDT0000";
char *idstr = "cl2-dirwatch";
long long end_record = 12345678;

rc = llapi_changelog_clear(mdtname, idstr, end_record);

ate. no notes. ✨


⭐ AVAILABILITY ⭐

llapi_changelog_clear() has been part of the lustre(7) user application interface library since release 2.0.0. a true veteran, honestly.


πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group, together at last 🫢 go read them too, they're all main characters.


and that's the page!! πŸ’– this lil masterpiece came out of the Lustre User API, dated 2024-08-22, and it lives under the name LLAPI_CHANGELOG_CLEAR(3) β€” so if you ever forget where you found it, just know it says its own name three times like a legend. periodt. πŸ’…

πŸ“¦ where this page comes from