{"record":{"id":"7954157f35e6a81d","repo":"vectordotdev/vector","slug":"vector-only-supports-record-sizes-that-fit-in-u64","errorCode":null,"errorMessage":"Vector only supports record sizes that fit in u64","messagePattern":"Vector only supports record sizes that fit in u64","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"lib/vector-buffers/src/variants/disk_v2/reader.rs","lineNumber":145,"sourceCode":"impl<T> ReaderError<T>\nwhere\n    T: Bufferable,\n{\n    pub(super) fn is_bad_read(&self) -> bool {\n        matches!(\n            self,\n            ReaderError::Checksum { .. }\n                | ReaderError::Deserialization { .. }\n                | ReaderError::PartialWrite\n        )\n    }\n\n    pub(super) fn consumed_record_bytes(&self) -> Option<u64> {\n        match self {\n            ReaderError::Checksum { record_bytes, .. }\n            | ReaderError::Deserialization { record_bytes, .. } => Some(\n                u64::try_from(*record_bytes)\n                    .expect(\"Vector only supports record sizes that fit in u64\"),\n            ),\n            _ => None,\n        }\n    }\n\n    fn as_error_code(&self) -> &'static str {\n        match self {\n            ReaderError::Io { .. } => \"io_error\",\n            ReaderError::Deserialization { .. } => \"deser_failed\",\n            ReaderError::Checksum { .. } => \"checksum_mismatch\",\n            ReaderError::Decode { .. } => \"decode_failed\",\n            ReaderError::Incompatible { .. } => \"incompatible_record_version\",\n            ReaderError::PartialWrite => \"partial_write\",\n            ReaderError::EmptyRecord => \"empty_record\",\n        }\n    }\n\n    pub fn as_recoverable_error(&self) -> Option<BufferReadError> {","sourceCodeStart":127,"sourceCodeEnd":163,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/lib/vector-buffers/src/variants/disk_v2/reader.rs#L127-L163","documentation":"`ReaderError::consumed_record_bytes` reports how many payload bytes a checksum-mismatched or deserialization-failed record consumed, converting the error's `record_bytes: usize` to `u64` for ledger accounting. On supported platforms the conversion is total, so this expect is a documented impossibility guarding hypothetical >64-bit `usize` targets.","triggerScenarios":"A Checksum or Deserialization ReaderError carrying record_bytes larger than u64::MAX — impossible on 32/64-bit targets regardless of on-disk state, because the byte count originates from a real buffer/file length.","commonSituations":"None in practice; byte counts derive from actual reads, which cannot approach 2^64 on supported hardware.","solutions":["No action possible; if it appears, treat it as an upstream bug and report the backtrace"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Nothing to guard: byte counts derive from real I/O sizes that fit u64 on supported platforms","Report any occurrence upstream with a backtrace"],"tags":["rust","vector","disk-buffer","invariant","integer-conversion","panic"],"backgroundTag":"integer-width-conversion-panic","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T20:17:18.057Z"}