{"record":{"id":"c204b190ed04ddf8","repo":"vectordotdev/vector","slug":"event-count-for-a-record-cannot-exceed-2-64-events","errorCode":null,"errorMessage":"Event count for a record cannot exceed 2^64 events.","messagePattern":"Event count for a record cannot exceed 2\\^64 events\\.","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"lib/vector-buffers/src/variants/disk_v2/checkpoint_recovery.rs","lineNumber":642,"sourceCode":"        let id = token.record_id();\n        let bytes = token.record_bytes() as u64;\n        let record = match record_reader.read_record(token) {\n            Ok(record) => record,\n            Err(error) => {\n                warn!(\n                    data_file_id = scan.file.id,\n                    record_id = id,\n                    record_bytes = bytes,\n                    %error,\n                    \"Checkpoint record payload is undecodable; counting its bytes.\"\n                );\n                return CheckpointRecord::undecodable(id, bytes);\n            }\n        };\n        let events: u64 = record\n            .event_count()\n            .try_into()\n            .expect(\"Event count for a record cannot exceed 2^64 events.\");\n        if events == 0 {\n            warn!(\n                data_file_id = scan.file.id,\n                record_id = id,\n                record_bytes = bytes,\n                \"Checkpoint record payload is empty; counting its bytes.\"\n            );\n            return CheckpointRecord::undecodable(id, bytes);\n        }\n\n        let next_id = id + events;\n        let last_id = next_id - 1;\n\n        CheckpointRecord {\n            id,\n            bytes,\n            events: Some(events),\n            next_id: Some(next_id),","sourceCodeStart":624,"sourceCodeEnd":660,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/lib/vector-buffers/src/variants/disk_v2/checkpoint_recovery.rs#L624-L660","documentation":"While scanning a data-file boundary in disk_v2 checkpoint recovery, each record's event count (stored as `usize`) is converted to `u64` so record IDs can advance correctly. The expect documents the invariant that an event count always fits in u64 on supported platforms. It cannot fire on 32/64-bit builds and indicates an internal bug or memory corruption if observed.","triggerScenarios":"record.event_count() exceeding u64::MAX during a CheckpointBoundaryScan — impossible on 32/64-bit targets; no config, data, or environment state reaches it.","commonSituations":"None in practice; would only surface alongside memory corruption or an exotic custom platform.","solutions":["Treat as a bug: capture the backtrace and report it upstream","Check hardware/memory stability if panics recur","Move the buffer data directory aside to restore service"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No caller-side guard exists; treat any occurrence as an upstream bug","Maintain the ability to recreate the buffer data directory quickly to restore throughput"],"tags":["rust","vector","disk-buffer","checkpoint","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"}