microsoft/FASTER · critical · FasterException

Invalid version found during commit recovery

Error message

Invalid version found during commit recovery

What it means

The version stamp read from the persisted commit-recovery metadata is negative or newer than FasterLogRecoveryVersion supported by this build (FasterLogRecoveryInfo.cs:94). The metadata file was written by an incompatible FasterLog version or is corrupt.

Solutions

  1. Use the same (or newer, format-compatible) FasterLog library version that wrote the log; align versions across all nodes.
  2. Restore from a checkpoint written by the current version.
  3. If corruption is suspected, inspect the metadata file header; restore the whole log directory from backup.
  4. Plan version migrations by fully committing and checkpointing before upgrading, never swapping library versions mid-life of a log.

Example fix

// before
// app updated to newer FasterLog, opens log written by old version -> invalid version

// after
// pin the package version that created the log, or export data via the old
// version's iterator and import into a fresh log with the new version
Defensive patterns

Strategy: try-catch

Try / catch

try { log = new FasterLog(options); } catch (FasterException ex) when (ex.Message == "Invalid version found during commit recovery") { OpenWithCompatibleVersionOrRestore(); }

Prevention

When it happens

Trigger: Opening a log with a newer FAST# / FasterLog version's commit files, or an older version than wrote them; corrupted first bytes of the metadata stream (e.g., torn write producing a bogus version).

Common situations: Rolling upgrades/downgrades across library versions; mixing NuGet package versions in a cluster; a crash that zeroed/garbled the recovery file header.

Understand the failure class

Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.

Related errors


AI-assisted analysis of microsoft/FASTER@321d872eab (2026-09-15). Data as JSON: /api/errors/059af4e1fa143a81. Report an issue: GitHub.

Appendix: source

Thrown at cs/src/core/FasterLog/FasterLogRecoveryInfo.cs:94

            int version;
            long checkSum;
            try
            {
                version = reader.ReadInt32();
                checkSum = reader.ReadInt64();
                BeginAddress = reader.ReadInt64();
                UntilAddress = reader.ReadInt64();
                if (version > 0)
                    CommitNum = reader.ReadInt64();
                else
                    CommitNum = -1;
            }
            catch (Exception e)
            {
                throw new FasterException("Unable to recover from previous commit. Inner exception: " + e.ToString());
            }
            if (version < 0 || version > FasterLogRecoveryVersion)
                throw new FasterException("Invalid version found during commit recovery");

            var iteratorCount = 0;
            try
            {
                iteratorCount = reader.ReadInt32();
            }
            catch { }

            if (iteratorCount > 0)
            {
                Iterators = new Dictionary<string, long>();
                for (int i = 0; i < iteratorCount; i++)
                {
                    int len = reader.ReadInt32();
                    byte[] bytes = reader.ReadBytes(len);
                    Iterators.Add(Encoding.UTF8.GetString(bytes), reader.ReadInt64());
                }
            }

View on GitHub (pinned to 321d872eab)