vectordotdev/vector · info
Default maximum data file size should never be greater than
Error message
Default maximum data file size should never be greater than 2^64 bytes.
What it means
When building a DiskBufferConfig without an explicit `max_data_file_size`, Vector converts the DEFAULT_MAX_DATA_FILE_SIZE constant (128 MiB, defined in common.rs) from `usize` to `u64`. The constant is fixed and fits trivially, so the expect is an assertion about build-time values only; it cannot fire for any user configuration.
Source
Thrown at lib/vector-buffers/src/variants/disk_v2/common.rs:324
FS2: Filesystem,
{
DiskBufferConfigBuilder {
data_dir: self.data_dir,
max_buffer_size: self.max_buffer_size,
max_data_file_size: self.max_data_file_size,
max_record_size: self.max_record_size,
write_buffer_size: self.write_buffer_size,
flush_interval: self.flush_interval,
filesystem,
}
}
/// Consumes this builder and constructs a `DiskBufferConfig`.
pub fn build(self) -> Result<DiskBufferConfig<FS>, BuildError> {
let max_buffer_size = self.max_buffer_size.unwrap_or(u64::MAX);
let max_data_file_size = self.max_data_file_size.unwrap_or_else(|| {
u64::try_from(DEFAULT_MAX_DATA_FILE_SIZE)
.expect("Default maximum data file size should never be greater than 2^64 bytes.")
});
let max_record_size = self.max_record_size.unwrap_or(DEFAULT_MAX_RECORD_SIZE);
let write_buffer_size = self.write_buffer_size.unwrap_or(DEFAULT_WRITE_BUFFER_SIZE);
let flush_interval = self.flush_interval.unwrap_or(DEFAULT_FLUSH_INTERVAL);
let filesystem = self.filesystem;
// Validate the input parameters.
if max_data_file_size == 0 {
return Err(BuildError::InvalidParameter {
param_name: "max_data_file_size",
reason: "cannot be zero".to_string(),
});
}
let data_file_size_mechanical_limit = get_maximum_data_file_size();
if max_data_file_size > data_file_size_mechanical_limit {
return Err(BuildError::InvalidParameter {
param_name: "max_data_file_size",View on GitHub (pinned to 3708c39b12)
Solutions
- No action possible or needed; report upstream if it ever appears
Defensive patterns
Strategy: validation
Prevention
- Nothing to guard: the default is a 128 MiB compile-time constant
- Setting an explicit max_data_file_size bypasses this line entirely if you want determinism
When it happens
Trigger: u64::try_from(DEFAULT_MAX_DATA_FILE_SIZE) failing — impossible since the constant is 128 * 1024 * 1024 and `usize` is at least 32-bit; only a hypothetical >64-bit `usize` target could trip it.
Common situations: None; the value is a compile-time literal.
Related errors
- event count should never exceed u64
- Event count for a record cannot exceed 2^64 events.
- Ledger length cannot be greater than `u64`.
- Vector only supports record sizes that fit in u64
- record was already validated
AI-assisted analysis of vectordotdev/vector@3708c39b12 (2026-08-20).
Data as JSON: /api/errors/5102291c2212dfce.
Report an issue: GitHub.