PMEMPOOL_SYNC(3)
π PMEMPOOL_SYNC(3) β PMDK Programmer's Manual π
okay bestie, sit down, hydrate, because today we're learning about pmempool_sync() and pmempool_transform() β the pool set glow-up functions. yes, the manual page name is PMEMPOOL_SYNC(3) and yes it lives in the PMDK Programmer's Manual, we're just folding that in here so it looks cute. π
β¨ NAME β¨
pmempool_sync(), pmempool_transform() β pool set synchronization and transformation
so like... syncing your replicas and reshaping your whole pool set structure. main character energy for real. π
πΈ SYNOPSIS πΈ
#include <libpmempool.h>
int pmempool_sync(const char *poolset_file, unsigned flags); (EXPERIMENTAL)
int pmempool_transform(const char *poolset_file_src,
const char *poolset_file_dst, unsigned flags); (EXPERIMENTAL)
π both of these are EXPERIMENTAL, so clock that before you ship them anywhere important.
π¦ DESCRIPTION π¦
π pmempool_sync()
The pmempool_sync() function synchronizes data between replicas within a pool set. like, it makes all your replicas agree on reality. vibe alignment, if you will. β¨
pmempool_sync() accepts two arguments:
poolset_fileβ a path to a pool set file,flagsβ a combination of flags (ORed) which modify how synchronization is performed.
β οΈ NOTE: Only the pool set file used to create the pool should be used for syncing the pool. no random other poolset file, bestie, that's not it.
β οΈ NOTE: The pmempool_sync() cannot do anything useful if there are no replicas in the pool set. In such case, it fails with an error. zero replicas = zero slay, it just gives up.
β οΈ NOTE: Replication is only supported for libpmemobj(7) pools.
The following flags are available:
PMEMPOOL_SYNC_DRY_RUNβ do not apply changes, only check for viability of synchronization. it's giving "window shopping" ποΈ β you look, you don't buy.
pmempool_sync() checks that the metadata of all replicas in a pool set is consistent, i.e. all parts are healthy, and if any of them is not, the corrupted or missing parts are recreated and filled with data from one of the healthy replicas. iconic. it heals what's broken using data from the ones that are thriving. π«Ά
If a pool set has the option SINGLEHDR (see poolset(5)), the internal metadata of each replica is limited to the beginning of the first part in the replica. If the option NOHDRS is used, replicas contain no internal metadata. In both cases, only the missing parts or the ones which cannot be opened are recreated with the pmempool_sync() function.
π pmempool_transform()
pmempool_transform() modifies the internal structure of a pool set. it's the makeover episode. π
It supports the following operations:
- adding one or more replicas,
- removing one or more replicas,
- adding or removing pool set options.
Only one of the above operations can be performed at a time. pick ONE, bestie, we are not doing a three-for-one here. π
pmempool_transform() accepts three arguments:
poolset_file_srcβ pathname of the pool set file for the source pool set to be changed,poolset_file_dstβ pathname of the pool set file that defines the new structure of the pool set,flagsβ a combination of flags (ORed) which modify how synchronization is performed.
The following flags are available:
PMEMPOOL_TRANSFORM_DRY_RUNβ do not apply changes, only check for viability of transformation. again, just a lil preview, no commitment. π
β οΈ NOTE: The transform operation is only supported for libpmemobj(7) pools.
π RETURN VALUE π
pmempool_sync() and pmempool_transform() return 0 on success. Otherwise, they return -1 and set errno appropriately.
zero = we ate. minus one = something went off and errno is gonna tell you exactly what. π
π₯ ERRORS π₯
EINVALβ Invalid format of the input/output pool set file.EINVALβ Unsupported flags value.EINVALβ There is only master replica defined in the input pool set passed topmempool_sync().EINVALβ The source pool set passed topmempool_transform()is not alibpmemobjpool.EINVALβ The input and output pool sets passed topmempool_transform()are identical.EINVALβ Attempt to perform more than one transform operation at a time.
π NOTES π
- The
pmempool_sync()API is experimental and it may change in future versions of the library. - The
pmempool_transform()API is experimental and it may change in future versions of the library.
π say it with me: EXPERIMENTAL. it may change on you. do not be surprised. iykyk.
π SEE ALSO π
libpmemobj(7) and https://pmem.io
okay that's the whole page, you're officially educated π this was the PMDK Programmer's Manual, dated 2025-07-24, brought to you by PMDK β go forth and sync responsibly, bestie. no cap. π¦β¨
π¦ where this page comes from
- fedora 43: libpmempool-devel 2.1.0-4.fc43 Β· BSD-3-Clause
- π the page's license: BSD-3-Clause
- Copyright 2017-2022, Intel Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms