Conversation
…, cron scheduling, AI/ML advisor hook, and YAML config (IA-01…IA-15) Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/12704eda-57a9-409b-ac6f-53424ae92021 Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
…cs, unique tmp file in tests Agent-Logs-Url: https://github.com/makr-code/ThemisDB/sessions/12704eda-57a9-409b-ac6f-53424ae92021 Co-authored-by: makr-code <150588092+makr-code@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
makr-code
April 22, 2026 14:34
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds
IndexAnalyzer, a per-index health analysis engine that computes fragmentation from RocksDB SST metrics, classifies it against hot/warm/cold tier thresholds, and produces a maintenance recommendation. Fully driven by YAML config; supports cron-based scheduling and an opt-in AI/ML override hook.Core components
include/storage/index_analyzer.h—TierThresholds(3-tier defaults),IndexAnalysisReport,IndexRecommendation(NONE → UPDATE_STATS → REORGANIZE → PARTIAL_REBUILD → FULL_REBUILD),IIndexAnalysisAdvisorinterface,IndexAnalyzerclasssrc/storage/index_analyzer.cpp— Fragmentation computed from(total_sst - live_sst) / total_sst + L0_files × 2%; heuristic constants named (kFragPctPerL0File,kBytesPerMB, etc.); cron loop viacv_.wait_until(next_fire), re-evaluates onsetConfig(); AI advisor exceptions caught, rule-based result preservedconfig/index_analyze.yaml— Reference YAML; per-tier threshold blocks + per-index overrides +ai_advisortoggleTier threshold defaults
Looser thresholds for warm/cold: rebuild cost on SATA/object-storage dominates.
AI/ML intervention hook
Known limitation
stats_age_hoursis currently fixed atkPlaceholderStatsAgeHours = 2. Real staleness tracking requires astats_last_updatedkey in a dedicated metadata CF — tracked inFUTURE_ENHANCEMENTS.md.Build wiring
index_analyzer.cppadded tocmake/StorageEnhancements.cmake,cmake/CMakeLists.txt,cmake/ModularBuild.cmake. Test targetIndexAnalyzerFocusedTests(IA-01…IA-15) registered intests/CMakeLists.txt.Linked Issues
Type of Change
Breaking Change Checklist
VERSIONandCMakeLists.txtdocs/migration/### Removed/### Changedsection updatedTesting
Tests cover: tier threshold defaults, YAML load (valid + missing-file error path), null
db_wrapperguard,setConfig/setAdvisorthread safety, all fiveclassify()branches,lastReports()initial state. Pure-logic tests (IA-01…IA-09, IA-10…IA-15) require no live RocksDB instance.📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
[Unreleased]