influxdata/influxdb · error · EnterpriseCatalogError
gen2 duration must be an even multiple of gen1 duration…
Error message
gen2 duration must be an even multiple of gen1 duration, provided gen2 duration: {gen2_duration_secs} seconds, existing gen1 duration: {gen1_duration_secs} seconds What it means
EnterpriseCatalogError::InvalidGen2Duration. Raised when a requested gen2 duration is not an even multiple of the existing gen1 duration. Generation windows must nest cleanly for compaction; a misaligned gen2 value makes the generation plan invalid. The error reports both durations in seconds.
Solutions
- Choose a gen2 duration that is an exact multiple of gen1 (e.g. gen1=10m, gen2=60m).
- If gen1 must change, update gen1 first so the new gen2 divides evenly, or change both together.
- Compute the multiple programmatically before applying the config: gen2_secs % gen1_secs == 0.
- Check the catalog's current gen1 duration rather than assuming a default.
Example fix
// before influxdb3 serve --gen1-duration 10m --gen2-duration 15m // 15 % 10 != 0 // after influxdb3 serve --gen1-duration 10m --gen2-duration 60m // 60 % 10 == 0
Defensive patterns
Strategy: validation
Validate before calling
#!/bin/sh
# gen2 must be an even multiple of gen1 (seconds)
[ $((GEN2_SECS % GEN1_SECS)) -eq 0 ] || { echo "gen2 must be a multiple of gen1"; exit 1; } Try / catch
match result {
Err(EnterpriseCatalogError::InvalidGen2Duration { gen2_duration_secs, gen1_duration_secs }) =>
eprintln!("gen2 {}s is not a multiple of gen1 {}s", gen2_duration_secs, gen1_duration_secs),
other => other?,
} Prevention
- Pick durations from a doubling/nesting ladder (e.g. 10m -> 60m -> 360m)
- Compute gen2 as gen1 * k, never an independent value
- Re-validate durations after any gen1 change
- Add a preflight divisibility check to config deployment
When it happens
Trigger: Starting or reconfiguring a node with `--gen2-duration` set to a value that the catalog's gen1 duration does not evenly divide — e.g. gen1=10m, gen2=15m.
Common situations: Manual duration tuning without checking divisibility; changing gen1 duration after gen2 was configured; copying configs between clusters with different gen1 settings.
Understand the failure class
Background: "Invalid value" and "allowed values are" config errors: what your library rejected and how to fix it — this error's family across 41 libraries.
Related errors
- each subsequent generation must be an even multiple of its…
- gen1 duration is not configured in the catalog
- Node doesn't have proper mode, expect
- too many compacted generations requested, maximum allowed…
- An unexpected error occurred in the client library
AI-assisted analysis of influxdata/influxdb@06200ef96b (2026-09-19).
Data as JSON: /api/errors/5850865ddc145ef5.
Report an issue: GitHub.
Appendix: source
Thrown at influxdb3_catalog/src/error/enterprise.rs:42
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.as_str())
}
}
#[derive(Debug, thiserror::Error, Clone, Copy)]
pub enum EnterpriseCatalogError {
#[error("Node doesn't have proper mode, expect {expected}")]
InvalidNodeMode { expected: NodeMode },
#[error(
"too many compacted generations requested, maximum allowed: 254, requested: {requested}"
)]
TooManyCompactedGenerations { requested: usize },
#[error("gen1 duration is not configured in the catalog")]
MissingGen1Duration,
#[error(
"gen2 duration must be an even multiple of gen1 duration, \
provided gen2 duration: {gen2_duration_secs} seconds, \
existing gen1 duration: {gen1_duration_secs} seconds"
)]
InvalidGen2Duration {
gen2_duration_secs: u64,
gen1_duration_secs: u64,
},
#[error("each subsequent generation must be an even multiple of its predecessor")]
MisalignedGenerations,
}
View on GitHub (pinned to 06200ef96b)