Skip to main content

nanos

Function nanos 

Source
pub(crate) fn nanos(t: u64) -> i64
Expand description

One OTLP fixed64 nanosecond timestamp, read into the Int64 Arrow uses.

Everything at or above 2^63 is unrepresentable, and it arrives: a skewed clock, an SDK that scales seconds to nanoseconds twice, or one line of curl. Reading it as zero — the same value the wire uses for “unset” — is the only clamp honest at both ends. A raw as i64 wraps negative, and a negative min_ts renders as a directory name starting with -, which block::parse_dir_name splits into an empty first field and rejects: the block is published, the export is acked as durable, and no query and no retention sweep can ever see it again. Saturating to i64::MAX avoids the wrap but pushes max_ts past every cutoff block::expire will ever compute, which is the same disk leak by a longer route.

So this follows append_fixed: a malformed value reads as absent, and the absent-value path each signal already has takes it from there.