PREQUEL-2025-0097
Loki Compactor Schema Table MismatchMediumImpact: 6/10Mitigation: 5/10
PREQUEL-2025-0097View on GitHub
Description
Loki compactor encounters schema configuration mismatches when it finds index tables in object storage
that don't correspond to any configured schema period in the Loki configuration. This causes the compactor
to skip compaction for those tables, leading to storage inefficiency and potential query performance degradation.
The issue typically occurs after schema migrations, configuration changes, or when legacy data exists with
different table naming conventions.
Cause
- Index table names/prefixes in object storage don't match any schema_config.configs entry
- Schema configuration changes that orphaned existing index tables
- Incomplete schema migrations leaving legacy table structures
- Mismatched index prefix configuration between schema periods
- Object storage containing tables from deleted or modified schema configurations
Mitigation
- Review schema_config.configs in Loki configuration to ensure all expected table prefixes are covered
- Add missing schema entries for orphaned index tables if data should be retained
- Update index prefix settings to match existing table names in object storage
- Clean up orphaned index tables if they represent obsolete data
- Implement proper schema migration procedures for future changes
- Monitor compactor logs for schema mismatch patterns during configuration changes
- Document schema evolution and table naming conventions for operational teams