valeriansaliou/sonic · critical · panic

consolidate_after for fst must be strictly lower than inacti

Error message

consolidate_after for fst must be strictly lower than inactive_after

What it means

Config::validate() panics when the FST (full-text) graph's consolidate_after duration is greater than or equal to the FST pool's inactive_after duration. Consolidation must be scheduled strictly before the pool can deactivate an instance, so the config is rejected at startup.

Source

Thrown at core/src/config.rs:55

        if self.store.kv.database.write_buffer_size == Some(0) {
            panic!("write_buffer for kv must not be zero");
        }

        // Check 'flush_after' for KV
        if self.store.kv.database.flush_after >= self.store.kv.pool.inactive_after {
            panic!("flush_after for kv must be strictly lower than inactive_after");
        }

        // Check 'flush_after' for KV
        if self.store.kv.database.max_flushes.is_some()
            && self.store.kv.database.max_background_jobs.is_some()
        {
            panic!("max_background_jobs makes max_flushes unneeded, don’t configure both");
        }

        // Check 'consolidate_after' for FST
        if self.store.fst.graph.consolidate_after >= self.store.fst.pool.inactive_after {
            panic!("consolidate_after for fst must be strictly lower than inactive_after");
        }
    }
}

/// Configuration group for normalization options (Unicode normalization,
/// stemming, lemmatization…).
#[derive(Deserialize, Clone, Copy)]
pub struct ConfigNormalization {
    #[serde(with = "crate::util::serde::none_string_as_none")]
    pub unicode_normalization: Option<UnicodeNormalization>,

    pub diacritic_folding_enabled: bool,

    #[cfg(feature = "stemming")]
    pub stemming_enabled: bool,
}

#[derive(Deserialize, Debug, Clone, Copy)]

View on GitHub (pinned to e6a72da6a5)

Solutions

  1. Lower consolidate_after under [store.fst.graph] so it is strictly less than inactive_after
  2. Raise inactive_after under [store.fst.pool] above consolidate_after
  3. Restart the server after fixing the config

Example fix

// config.toml
// before
[store.fst.graph]
consolidate_after = 600
[store.fst.pool]
inactive_after = 300

// after
[store.fst.graph]
consolidate_after = 120
[store.fst.pool]
inactive_after = 300
Defensive patterns

Strategy: validation

Validate before calling

assert!(
    cfg.store.fst.graph.consolidate_after < cfg.store.fst.pool.inactive_after,
    "fst consolidate_after must be strictly lower than inactive_after"
);

Prevention

When it happens

Trigger: Configuring [store.fst.graph] consolidate_after >= [store.fst.pool] inactive_after and starting the server.

Common situations: Tuning the FST index consolidation schedule; copying durations between KV and FST sections; unit mix-ups making consolidate_after appear larger than inactive_after.

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


AI-assisted analysis of valeriansaliou/sonic@e6a72da6a5 (2026-09-01). Data as JSON: /api/errors/263f86c528b18f74. Report an issue: GitHub.