{"record":{"id":"630520444826a072","repo":"influxdata/influxdb","slug":"too-many-compacted-generations-requested-maximum-allowed-254","errorCode":null,"errorMessage":"too many compacted generations requested, maximum allowed: 254, requested: {requested}","messagePattern":"too many compacted generations requested, maximum allowed: 254, requested: (.+?)","errorType":"validation","errorClass":"EnterpriseCatalogError","httpStatus":null,"severity":"error","filePath":"influxdb3_catalog/src/error/enterprise.rs","lineNumber":34,"sourceCode":"            NodeMode::Compact => \"compact\",\n            NodeMode::Process => \"process\",\n            NodeMode::All => \"all\",\n        }\n    }\n}\n\nimpl std::fmt::Display for NodeMode {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        write!(f, \"{}\", self.as_str())\n    }\n}\n\n#[derive(Debug, thiserror::Error, Clone, Copy)]\npub enum EnterpriseCatalogError {\n    #[error(\"Node doesn't have proper mode, expect {expected}\")]\n    InvalidNodeMode { expected: NodeMode },\n\n    #[error(\n        \"too many compacted generations requested, maximum allowed: 254, requested: {requested}\"\n    )]\n    TooManyCompactedGenerations { requested: usize },\n\n    #[error(\"gen1 duration is not configured in the catalog\")]\n    MissingGen1Duration,\n\n    #[error(\n        \"gen2 duration must be an even multiple of gen1 duration, \\\n        provided gen2 duration: {gen2_duration_secs} seconds, \\\n        existing gen1 duration: {gen1_duration_secs} seconds\"\n    )]\n    InvalidGen2Duration {\n        gen2_duration_secs: u64,\n        gen1_duration_secs: u64,\n    },\n\n    #[error(\"each subsequent generation must be an even multiple of its predecessor\")]","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/influxdata/influxdb/blob/06200ef96ba82c5f6727e5038a83af8e722c6875/influxdb3_catalog/src/error/enterprise.rs#L16-L52","documentation":"EnterpriseCatalogError::TooManyCompactedGenerations. The Enterprise catalog caps the number of compacted generations a database may request at 254 (a u8-derived limit); this error fires when an operation asks for more than that. It includes the requested count for diagnosis.","triggerScenarios":"Requesting generation compaction/ordering with a list of generations longer than 254, e.g. via the generation-request API or catalog op that enumerates compacted generations for a database with a very long generation history.","commonSituations":"Databases accumulating thousands of generations without pruning; batch scripts requesting compaction of the entire generation history at once; misconfigured retention that never expires old generations.","solutions":["Split the compaction request into chunks of at most 254 generations.","Prune expired/old generations first so the active set shrinks below the cap.","Check gen1/gen2 duration configuration: durations that are too small inflate generation counts quickly.","Increase compaction frequency so fewer generations accumulate between runs."],"exampleFix":"// before\nrequest_generations(all_generations)  // 400 generations\n// after\nfor chunk in all_generations.chunks(254) {\n    request_generations(chunk)?;\n}","handlingStrategy":"validation","validationCode":"if generations.len() > 254 {\n    // chunk or prune before requesting compaction\n}","typeGuard":null,"tryCatchPattern":"match result {\n    Err(EnterpriseCatalogError::TooManyCompactedGenerations { requested }) =>\n        eprintln!(\"{} generations requested; cap is 254 — chunk or prune\", requested),\n    other => other?,\n}","preventionTips":["Chunk generation requests to <= 254 items","Enable retention/pruning so generation counts stay bounded","Avoid overly small gen1 durations that inflate generation counts","Compact regularly instead of batching long histories"],"tags":["enterprise","generations","limit-exceeded","compaction"],"backgroundTag":"value-out-of-range","analyzedSha":"06200ef96ba82c5f6727e5038a83af8e722c6875","analyzedAt":"2026-09-19T12:55:30.003Z","contentChangedAt":"2026-09-19T12:55:30.003Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}