Enable read-copy-update (RCU) behavior for sync operations. The
current latest immutable version of a repository will be
reference by a symlink found where the repository would normally
be located. Repository consumers should resolve the cannonical
path of this symlink before attempt to access the repository,
and all operations should be read-only, since the repository
is considered immutable. Updates occur by atomic replacement
of the symlink, which causes new consumers to use the new
immutable version, while any earlier consumers continue to use
the cannonical path that was resolved earlier.
Performance is better than HardlinkQuarantineRepoStorage,
since commit involves atomic replacement of a symlink. Since
the symlink usage would require special handling for scenarios
involving bind mounts and chroots, this module is not enabled
Directory path reserved for sync-rcu storage. This
directory must have a unique value for each repository
(do not set it in the DEFAULT section). This directory
must not contain any other files or directories aside
from those that are created automatically when sync-rcu
sync-rcu-spare-snapshots = 1
Number of spare snapshots for sync-rcu to retain with
expired ttl. This protects the previous latest snapshot
from being removed immediately after a new version
becomes available, since it might still be used by
sync-rcu-ttl-days = 7
Number of days for sync-rcu to retain previous immutable
snapshots of a repository. After the ttl of a particular
snapshot has expired, it will be remove automatically (the
latest snapshot is exempt, and sync-rcu-spare-snapshots
configures the number of previous snapshots that are
exempt). If the ttl is set too low, then a snapshot could
expire while it is in use by a running process.
Run cmd and raise RepoStorageException on failure.
When repo.user_location is a normal directory, migrate it to
storage so that it can be replaced with a symlink. After migration,
commit the content as the latest snapshot.
Delete the current update directory. If there was not an update
in progress, or it has already been committed, then this has
Commit the current update directory, so that is becomes the
latest immutable snapshot.
Get the current update directory which would have been returned
from the most recent call to the init_update method. This raises
RepoStorageException if the init_update method has not been
- Return type
path of directory to update
Remove expired snapshots.
Create an update directory as a destination to sync updates to.
The directory will be populated with files from the previous
immutable snapshot, if available. Note that this directory
may contain hardlinks that reference files in the previous
immutable snapshot, so these files should not be modified
(tools like rsync and git normally break hardlinks when
files need to be modified).
- Return type
path of directory to update, populated with files from
the previous snapshot if available