{"record":{"id":"2067242351196c66","repo":"vectordotdev/vector","slug":"should-not-fail-to-add-marker-for-data-file-comple","errorCode":null,"errorMessage":"should not fail to add marker for data file completion","messagePattern":"should not fail to add marker for data file completion","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"info","filePath":"lib/vector-buffers/src/variants/disk_v2/reader.rs","lineNumber":782,"sourceCode":"        let bytes_read = self.bytes_read;\n\n        debug!(\n            data_file_path = data_file_path.to_string_lossy().as_ref(),\n            first_record_id = data_file_start_record_id,\n            last_record_id = self.last_reader_record_id,\n            record_count = data_file_record_count,\n            event_count = data_file_event_count,\n            bytes_read,\n            \"Marking data file for completion.\"\n        );\n\n        let data_file_marker_id = self.data_file_marked_record_count;\n        self.data_file_marked_record_count += data_file_record_count;\n        self.data_file_record_count = 0;\n\n        self.data_file_acks\n            .add_marker(data_file_marker_id, Some(data_file_record_count), None)\n            .expect(\"should not fail to add marker for data file completion\");\n\n        // Now reset our internal state so we can go for the next data file.\n        self.reset();\n        self.ledger.increment_unacked_reader_file_id();\n\n        debug!(\"Rolling to next data file.\");\n    }\n\n    /// Ensures this reader is ready to attempt reading the next record.\n    #[cfg_attr(test, instrument(skip(self), level = \"debug\"))]\n    async fn ensure_ready_for_read(&mut self) -> io::Result<()> {\n        // We have nothing to do if we already have a data file open.\n        if self.reader.is_some() {\n            return Ok(());\n        }\n\n        // Try to open the current reader data file.  This might not _yet_ exist, in which case\n        // we'll simply wait for the writer to signal to us that progress has been made, which","sourceCodeStart":764,"sourceCodeEnd":800,"githubUrl":"https://github.com/vectordotdev/vector/blob/3708c39b12a93212ed8b8d7510b4cc7769cb5864/lib/vector-buffers/src/variants/disk_v2/reader.rs#L764-L800","documentation":"When the v2 disk reader finishes a data file, it appends a completion marker to its in-memory acknowledgement ledger at the current record offset. `add_marker` fails when the new marker would not follow the existing ones (IDs out of order), which cannot happen because data_file_marked_record_count advances monotonically with each roll; the expect surfaces internal offset-accounting regressions only.","triggerScenarios":"roll_to_next_data_file adding a marker whose ID is not greater than the last marker's — no external input, config, or on-disk state influences these in-memory counters; only a code regression trips it.","commonSituations":"None in practice; marker state is process-local and sequential by construction.","solutions":["No user action; if it fires, capture RUST_BACKTRACE=1 output and report it upstream with the Vector version"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["No caller-side guard exists; marker order is process-local and monotonic by construction","Report any occurrence upstream with the Vector version and backtrace"],"tags":["rust","vector","disk-buffer","invariant","panic"],"backgroundTag":"internal-invariant-panic","analyzedSha":"3708c39b12a93212ed8b8d7510b4cc7769cb5864","analyzedAt":"2026-08-20T07:02:18.786Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}