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. The values:

    • Version1 keeps a repository usable and cleanable by every FulcrumFS version, 1.0.x included, and upgrades nothing.
    • Version2 adds delete journals, which record the deletions of a staged transaction, or of an ordinary one that commits several, in one file. FulcrumFS 2.0 and later can use and clean a version 2 repository.
    • Latest is the newest format of the library in use, so updating the library to one with a newer format upgrades the repository the next time it is opened, after which older libraries refuse it.

    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. It reads as Unspecified while it is not set, and the FileRepo constructor throws an ArgumentException that names the choices when it has not been set.

    Exceptions
    Type Condition
    ArgumentOutOfRangeException

    The value is not Version1, Version2 or Latest, other than Unspecified while it is not set.

    © Singulink. All rights reserved.