Summary
Keldra 0.14.0 returns DataLoss / Unrecoverable data loss or corruption when a typed JSON boolean query references optional indexed fields that are absent from every document in one format-v4 segment.
This reproduces on a newly created Docker volume, so it is not an upgrade or stale-index problem.
Version
- Release/tag:
0.14.0, commit 4352bbd2
- Image:
ghcr.io/keldra-store/keldra:0.14.0
- Single-node, local durability, fresh volume
Index shape
Create a typed JSON index over a broad REST-style prefix with:
- exact keyword
object_kind
- exact keyword
status
- exact signed integer
engine_task_id
- range signed integer
next_eval_at_unix_ms
- range signed integer
lease_expires_at_unix_ms
Documents under the prefix legitimately have different kinds. Some documents contain object_kind but omit the optional scheduling fields entirely.
Query shape
The failing predicate is equivalent to:
all(
equal(object_kind, "task"),
in(status, ["ready", "deferred", "waiting", "running"]),
any(
not(exists(next_eval_at_unix_ms)),
less_than_or_equal(next_eval_at_unix_ms, now)
),
any(
not(exists(lease_expires_at_unix_ms)),
less_than_or_equal(lease_expires_at_unix_ms, now)
)
)
Once the index contains a segment built from JSON documents that do not have one of those optional range fields, QueryIndex repeatedly fails with:
code: Unrecoverable data loss or corruption
message: invalid index format: format-v4 segment lacks a required component stream
The error originates from the missing-component assumptions in crates/keldra-index/src/v4/executor/posting.rs / segment_reader.rs.
Expected behavior
A missing optional field component in an otherwise valid sparse segment is not corruption:
exists(field) should evaluate false for documents/segments without that field.
not(exists(field)) should therefore include those documents, subject to the rest of the predicate.
- comparisons against an absent field should produce no matches for that branch.
- the query should return an ordinary empty or populated result, not
DataLoss.
Operational impact
A scheduler using the new 0.14 boolean predicates cannot query eligible records when its index covers heterogeneous JSON documents with optional due/lease fields. The failure occurs continuously on a fresh deployment and prevents work acquisition.
Summary
Keldra 0.14.0 returns
DataLoss/Unrecoverable data loss or corruptionwhen a typed JSON boolean query references optional indexed fields that are absent from every document in one format-v4 segment.This reproduces on a newly created Docker volume, so it is not an upgrade or stale-index problem.
Version
0.14.0, commit4352bbd2ghcr.io/keldra-store/keldra:0.14.0Index shape
Create a typed JSON index over a broad REST-style prefix with:
object_kindstatusengine_task_idnext_eval_at_unix_mslease_expires_at_unix_msDocuments under the prefix legitimately have different kinds. Some documents contain
object_kindbut omit the optional scheduling fields entirely.Query shape
The failing predicate is equivalent to:
Once the index contains a segment built from JSON documents that do not have one of those optional range fields,
QueryIndexrepeatedly fails with:The error originates from the missing-component assumptions in
crates/keldra-index/src/v4/executor/posting.rs/segment_reader.rs.Expected behavior
A missing optional field component in an otherwise valid sparse segment is not corruption:
exists(field)should evaluate false for documents/segments without that field.not(exists(field))should therefore include those documents, subject to the rest of the predicate.DataLoss.Operational impact
A scheduler using the new 0.14 boolean predicates cannot query eligible records when its index covers heterogeneous JSON documents with optional due/lease fields. The failure occurs continuously on a fresh deployment and prevents work acquisition.