Degraded

data class Degraded(val fromOffset: Long, val toOffset: Long, val reason: String, val cause: Throwable? = null) : DurabilityState

Frames in [fromOffset, toOffset) are written and readable, but not confirmed durable.

They are in the archive: whole, CRC-valid, and visible to every reader. What failed is the durability upgrade, which is why the appends that wrote them still reported AppendResult.WrittenAppendResult.Failed means "the ops are lost" and invites a re-feed, which would write a second copy of a record already on disk.

Sticky, and it widens rather than resetting. This state persists until a later flush whose range covers the whole of [fromOffset, toOffset) succeeds; while failures continue the range grows to cover them all. That is what preserves a once-and-then-cleared EIO.

Constructors

Link copied to clipboard
constructor(fromOffset: Long, toOffset: Long, reason: String, cause: Throwable? = null)

Properties

Link copied to clipboard

the most recent underlying failure, when the backend had one to hand.

Link copied to clipboard

the first append offset whose durability is in doubt. A backend that flushes at page granularity reports the start of the page range it covered, which need not land on a frame boundary — so this may point inside an earlier frame. It over-claims the doubt rather than under-claiming it, which is the only direction that is safe here, and a consumer treating it as "everything from at least here" is reading it correctly.

Link copied to clipboard

what the most recent failing flush said, errno text included where the backend has one. Earlier reasons are not accumulated; the range is what says how much is at risk.

Link copied to clipboard

one past the last such offset. May equal fromOffset: a flush that carried no frame of its own — a segment header — still leaves the archive's durability in doubt from that offset, and reporting no range at all would lose the fact entirely.