{"record":{"id":"5db71811760b4db0","repo":"vectordotdev/vector","slug":"skipping-more-than-2-64-events-at-a-time-is-obviou","errorCode":null,"errorMessage":"skipping more than 2^64 events at a time is obviously a bug","messagePattern":"skipping more than 2\\^64 events at a time is obviously a bug","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"lib/vector-buffers/src/variants/disk_v2/reader.rs","lineNumber":649,"sourceCode":"        if consumed_acks > 0 {\n            self.record_acks.add_acknowledgements(consumed_acks);\n\n            while let Some(EligibleMarker { len, data, .. }) =\n                self.record_acks.get_next_eligible_marker()\n            {\n                had_eligible_records = true;\n\n                match len {\n                    // Any marker with an assumed length implies a gap marker, which gets added\n                    // automatically and represents a portion of the record ID range that was\n                    // expected but missing. This is a long way of saying: we're missing records.\n                    //\n                    // We tally this up so that we can emit a single log event/set of metrics, as\n                    // there may be many gap markers and emitting for each of them could be very noisy.\n                    EligibleMarkerLength::Assumed(count) => {\n                        events_skipped = events_skipped\n                            .checked_add(count)\n                            .expect(\"skipping more than 2^64 events at a time is obviously a bug\");\n                    }\n                    // We got a valid marker representing a known number of events.\n                    EligibleMarkerLength::Known(len) => {\n                        // We specifically pass the size of the record, in bytes, as the marker data.\n                        let record_bytes = data.expect(\"record bytes should always be known\");\n\n                        records_acknowledged = records_acknowledged.checked_add(1).expect(\n                            \"acknowledging more than 2^64 records at a time is obviously a bug\",\n                        );\n                        events_acknowledged = events_acknowledged.checked_add(len).expect(\n                            \"acknowledging more than 2^64 events at a time is obviously a bug\",\n                        );\n                        bytes_acknowledged = bytes_acknowledged.checked_add(record_bytes).expect(\n                            \"acknowledging more than 2^64 bytes at a time is obviously a bug\",\n                        );\n                    }\n                }\n            }","sourceCodeStart":631,"sourceCodeEnd":667,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/lib/vector-buffers/src/variants/disk_v2/reader.rs#L631-L667","documentation":"While acknowledging records in the v2 disk reader, gap markers (record-ID ranges that were expected but missing) are tallied into a u64 accumulator via checked_add. Overflow would require more than 2^64 skipped events within one acknowledgement pass — more events than the entire u64 record-ID space allows — so the expect marks a logical impossibility whose only trigger is an internal ID-accounting bug.","triggerScenarios":"Accumulating more than u64::MAX skipped events in a single handle_pending_acknowledgements run; record IDs are u64 and bounded, so no buffer contents or acknowledgment pattern can legitimately reach it.","commonSituations":"None in practice; would indicate a record-ID arithmetic bug in Vector rather than an operational condition.","solutions":["Capture the backtrace (RUST_BACKTRACE=1) and report upstream","Move the buffer data directory aside to restore service while the bug is investigated"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No caller-side guard exists; the accumulator cannot legitimately overflow within the u64 record-ID space","Keep the recreate-data-directory recovery path available and report occurrences upstream"],"tags":["rust","vector","disk-buffer","invariant","overflow","panic"],"backgroundTag":"arithmetic-overflow-panic","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T01:17:15.007Z"}