microsoft/FASTER · error · ArgumentException

No such address exists

Error message

No such address exists

What it means

TieredStorageDevice fans reads/writes across multiple tiered devices by locating the device whose StartSegment range covers a given segment id. FindClosestDeviceContaining linearly scans the devices; if no device's StartSegment is <= the requested segment, the address lies outside all tiers and an ArgumentException is thrown.

Solutions

  1. Ensure the address/segment belongs to one of the configured tiers; verify firstDevice.StartSegment is 0 (or <= the smallest valid segment).
  2. Restore checkpoints with the same device-tier configuration that produced them.
  3. Add a tier whose StartSegment covers the missing segment range.
  4. Check whether you mistakenly passed a logical address instead of the expected segment-relative value.

Example fix

// before
// tier setup where first tier starts at segment 8; index still holds addresses from segment 0
var dev = new TieredStorageDevice(new[] { tier1, tier2 }); // tier1.StartSegment = 8
// after
var dev = new TieredStorageDevice(new[] { tier0 /* covers StartSegment 0 */, tier1, tier2 });
Defensive patterns

Strategy: validation

Validate before calling

bool covered = devices.Any(d => d.StartSegment <= segment);
if (!covered) throw new ArgumentOutOfRangeException(nameof(segment), $"Segment {segment} not covered by any tier");

Try / catch

try { device.ReadAsync(...); } catch (ArgumentException e) when (e.Message == "No such address exists") { log.LogError(e, "Address {Address} not covered by tier layout", address); }

Prevention

When it happens

Trigger: Calling FindClosestDeviceContaining (directly or via ReadAsync/WriteAsync on TieredStorageDevice) with a segment id smaller than the first tier's StartSegment (e.g., a checkpoint address from an earlier configuration) or one beyond every configured tier.

Common situations: Restoring a checkpoint taken with a different tier layout; shrinking the tier configuration while old data addresses persist in the index; CPR/disk-based checkpoints referencing addresses the current device set no longer covers; the null device (capacity -1) receiving an actual address.

Understand the failure class

Background: "value must be between 0 and 1" / "out of range" / "must not be negative" errors: fixing range-validation failures across open-source libraries — this error's family across 42 libraries.

Related errors


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

Appendix: source

Thrown at cs/src/core/Device/TieredStorageDevice.cs:171

            foreach (IDevice device in devices)
            {
                string formatString = "{0}, file name {1}, capacity {2} bytes;";
                string capacity = device.Capacity == Devices.CAPACITY_UNSPECIFIED ? "unspecified" : device.Capacity.ToString();
                result.AppendFormat(formatString, device.GetType().Name, device.FileName, capacity);
            }
            result.AppendFormat("commit point: {0} at tier {1}", devices[commitPoint].GetType().Name, commitPoint);
            return result.ToString();
        }

        private int FindClosestDeviceContaining(int segment)
        {
            // Can use binary search, but 1) it might not be faster than linear on a array assumed small, and 2) C# built in does not guarantee first element is returned on duplicates.
            // Therefore we are sticking to the simpler approach at first.
            for (int i = 0; i < devices.Count; i++)
            {
                if (devices[i].StartSegment <= segment) return i;
            }
            throw new ArgumentException("No such address exists");
        }
    }
}

View on GitHub (pinned to 321d872eab)