microsoft/FASTER · error · FasterException

requested commit num is not available

Error message

requested commit num is not available

What it means

When reading back at a specific commit number (e.g. via ReadAsync with a commitNum), the log may need to scan its records to find that commit's metadata. If the requested commit lies in a region already scanned but not found and fast commit mode is disabled, FasterLog cannot guarantee exact commit-number addressing and throws at FasterLog.cs:2377.

Solutions

  1. Enable FasterLogSettings.FastCommitMode = true so the log can scan forward for exact commit entries.
  2. Pass a commit num that is <= the latest committed commit num and still within the log's valid range (not truncated).
  3. Use an address-based ReadAsync instead of commit-number-based reading if exact commit metadata is unavailable.

Example fix

// before
var log = new FasterLog(new FasterLogSettings { LogDevice = device }); // FastCommitMode default false
var (result, _, commitNum) = await log.ReadAsync(address, readAtAddress: false, commitNum: 42);
// after
var log = new FasterLog(new FasterLogSettings { LogDevice = device, FastCommitMode = true });
var (result, _, commitNum) = await log.ReadAsync(address, readAtAddress: false, commitNum: 42);
Defensive patterns

Strategy: validation

Validate before calling

// before commit-num based read
if (requestedCommitNum > log.GetCommitNum() || requestedCommitNum < 0)
    throw new ArgumentOutOfRangeException(nameof(requestedCommitNum));

Try / catch

try { await log.ReadAsync(addr, readAtAddress: false, commitNum: n); } catch (FasterException ex) when (ex.Message.Contains("requested commit num is not available")) { // clamp commit num or fall back to address-based read
}

Prevention

When it happens

Trigger: Calling commit-number-based ReadAsync where the requested commit num's metadata is not directly available and FasterLogSettings.FastCommitMode is false (the default), so the log refuses to scan for it.

Common situations: Developers enable per-commit reads assuming exact commit addressing, but run with default settings where commit metadata lookup is approximate; also occurs when requesting a commit num that was never committed or was truncated from the log.

Understand the failure class

Background: 'Could not be found', 'does not exist', 'not found in database': the resource-not-found family when an ID, slug, key, or URI lookup comes back empty — this error's family across 20 libraries.

Related errors


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

Appendix: source

Thrown at cs/src/core/FasterLog/FasterLog.cs:2377

                if (metadataCommit > requestedCommitNum) continue;
                try
                {
                    if (LoadCommitMetadata(metadataCommit, out info))
                    {
                        scanStart = metadataCommit;
                        break;
                    }
                }
                catch { }
            }

            // Need to potentially scan log for the entry 
            if (scanStart < requestedCommitNum)
            {
                // If not in fast commit mode, do not scan log
                if (!fastCommitMode)
                    // In the case where precisely requested commit num is not available, can just throw exception
                    throw new FasterException("requested commit num is not available");

                // If no exact metadata is found, scan forward to see if we able to find a commit entry
                // Shut up safe guards, I know what I am doing
                CommittedUntilAddress = long.MaxValue;
                beginAddress = info.BeginAddress;
                allocator.HeadAddress = long.MaxValue;
                try
                {
                    using var scanIterator = Scan(info.UntilAddress, long.MaxValue, recover: false);
                    if (!scanIterator.ScanForwardForCommit(ref info, requestedCommitNum))
                        throw new FasterException("requested commit num is not available");
                }
                catch { }
            }

            // At this point, we should have found the exact commit num requested
            Debug.Assert(info.CommitNum == requestedCommitNum);
            if (!readOnlyMode)

View on GitHub (pinned to 321d872eab)