FulcrumFS FulcrumFS
FulcrumFS FulcrumFS
DocFX + Singulink = ♥

Search Results for

    Property MinimumFormatVersion

    MinimumFormatVersion

    Gets or sets the lowest format version the repository has once it is opened: a repository below it is upgraded when the FileRepo initializes, and one above it, within what this library supports, is used unchanged. Must be set: there is no default, because the right version depends on which processes and library versions use the repository.

    Declaration
    public required RepoFormatVersion MinimumFormatVersion { get; set; }
    Property Value
    Type Description
    RepoFormatVersion
    Remarks

    This is not a precondition: an older repository is upgraded, not refused. FormatVersion reports the version the repository actually has, which can be newer than this option. The library never changes the format of a repository on its own; this option is the only thing that does:

    • EnsureCreated() creates a new repository at this version.
    • An existing repository whose version is older is upgraded to this version when the FileRepo is initialized, which EnsureCreated() and EnsureInitialized() both do, and the first operation does if neither has been called. The upgrade is made while the instance holds the repository lock and before any operation runs.
    • A repository whose version is newer than this option, but supported by this library, is used with full access and is not changed.

    An upgraded repository can no longer be used or cleaned by an older library, which refuses it with a NotSupportedException; FulcrumFS 1.0.x cannot open a version 2 repository at all. Choose:

    • Version1 while any process that uses or cleans the repositories, including a cleanup job that runs separately from the application, still runs FulcrumFS 1.0.x. Once every one of them runs FulcrumFS 2.0 or later, set Version2.
    • Version2 for delete journals, which record the deletions of a staged transaction, or of an ordinary one that commits several, in one file, once every such process runs FulcrumFS 2.0 or later.
    • Latest only for repositories that the application owns exclusively, so that they always have the newest format of the library in use.

    The API behaves the same on a version 1 repository. The only difference is internal: transactions record their deletions with a marker per file instead of a delete journal, with the same guarantees at a cost that grows with the number of files. A repository opened in ReadOnly mode is never upgraded, whatever this option says.

    The requirement to set this option is enforced by the compiler only. Options bound from configuration and passed through IOptions<TOptions> must include it as well: there is no fallback, and the FileRepo constructor throws an ArgumentException that names the choices when it has not been set.

    © Singulink. All rights reserved.