.\" Automatically generated by Pandoc 2.9.2.1 .\" .TH "" "" "2023-05-26" "PMDK - " "PMDK Programmer's Manual" .hy .\" SPDX-License-Identifier: BSD-3-Clause .\" Copyright 2017-2022, Intel Corporation .SH NAME .PP \f[B]pmempool_sync\f[R](), \f[B]pmempool_transform\f[R]() - pool set synchronization and transformation .SH SYNOPSIS .IP .nf \f[C] #include 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) \f[R] .fi .SH DESCRIPTION .PP The \f[B]pmempool_sync\f[R]() function synchronizes data between replicas within a pool set. .PP \f[B]pmempool_sync\f[R]() accepts two arguments: .IP \[bu] 2 \f[I]poolset_file\f[R] - a path to a pool set file, .IP \[bu] 2 \f[I]flags\f[R] - a combination of flags (ORed) which modify how synchronization is performed. .RS .PP NOTE: Only the pool set file used to create the pool should be used for syncing the pool. .RE .RS .PP NOTE: The \f[B]pmempool_sync\f[R]() cannot do anything useful if there are no replicas in the pool set. In such case, it fails with an error. .RE .RS .PP NOTE: At the moment, replication is only supported for \f[B]libpmemobj\f[R](7) pools, so \f[B]pmempool_sync\f[R]() cannot be used with other pool types (\f[B]libpmemlog\f[R](7), \f[B]libpmemblk\f[R](7)). .RE .PP The following flags are available: .IP \[bu] 2 \f[B]PMEMPOOL_SYNC_DRY_RUN\f[R] - do not apply changes, only check for viability of synchronization. .PP \f[B]pmempool_sync\f[R]() 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. .PP If a pool set has the option \f[I]SINGLEHDR\f[R] (see \f[B]poolset\f[R](5)), the internal metadata of each replica is limited to the beginning of the first part in the replica. If the option \f[I]NOHDRS\f[R] 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 \f[B]pmempool_sync\f[R]() function. .PP \f[B]pmempool_transform\f[R]() modifies the internal structure of a pool set. It supports the following operations: .IP \[bu] 2 adding one or more replicas, .IP \[bu] 2 removing one or more replicas , .IP \[bu] 2 adding or removing pool set options. .PP Only one of the above operations can be performed at a time. .PP \f[B]pmempool_transform\f[R]() accepts three arguments: .IP \[bu] 2 \f[I]poolset_file_src\f[R] - pathname of the pool \f[I]set\f[R] file for the source pool set to be changed, .IP \[bu] 2 \f[I]poolset_file_dst\f[R] - pathname of the pool \f[I]set\f[R] file that defines the new structure of the pool set, .IP \[bu] 2 \f[I]flags\f[R] - a combination of flags (ORed) which modify how synchronization is performed. .PP The following flags are available: .IP \[bu] 2 \f[B]PMEMPOOL_TRANSFORM_DRY_RUN\f[R] - do not apply changes, only check for viability of transformation. .RS .PP NOTE: At the moment, \f[I]transform\f[R] operation is only supported for \f[B]libpmemobj\f[R](7) pools, so \f[B]pmempool_transform\f[R]() cannot be used with other pool types (\f[B]libpmemlog\f[R](7), \f[B]libpmemblk\f[R](7)). .RE .SH RETURN VALUE .PP \f[B]pmempool_sync\f[R]() and \f[B]pmempool_transform\f[R]() return 0 on success. Otherwise, they return -1 and set \f[I]errno\f[R] appropriately. .SH ERRORS .PP \f[B]EINVAL\f[R] Invalid format of the input/output pool set file. .PP \f[B]EINVAL\f[R] Unsupported \f[I]flags\f[R] value. .PP \f[B]EINVAL\f[R] There is only master replica defined in the input pool set passed to \f[B]pmempool_sync\f[R](). .PP \f[B]EINVAL\f[R] The source pool set passed to \f[B]pmempool_transform\f[R]() is not a \f[B]libpmemobj\f[R] pool. .PP \f[B]EINVAL\f[R] The input and output pool sets passed to \f[B]pmempool_transform\f[R]() are identical. .PP \f[B]EINVAL\f[R] Attempt to perform more than one transform operation at a time. .SH NOTES .PP The \f[B]pmempool_sync\f[R]() API is experimental and it may change in future versions of the library. .PP The \f[B]pmempool_transform\f[R]() API is experimental and it may change in future versions of the library. .SH SEE ALSO .PP \f[B]libpmemlog\f[R](7), \f[B]libpmemobj\f[R](7) and \f[B]\f[R]