Repository navigation
feat(storage): RocksDBWrapper proper size calculation via SST property + /v1/admin/storage/stats endpoint (v1.8.0 #205) - #4274
Merged
Conversation
…ssue #205) - getApproximateSize() now uses GetIntProperty('rocksdb.total-sst-files-size') as primary, with GetApproximateSizes(INCLUDE_FILES) fallback - getStats() JSON includes new 'total_sst_files_size_bytes' field - DiskSpaceMonitor: add rocksdb_size_bytes to SpaceInfo + setRocksDBSize() method - checkSpace() preserves rocksdb_size_bytes across OS disk queries - Add GET /v1/admin/storage/stats endpoint - Add focused tests (4 ACs) + CMakeLists registration + CI workflow Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
[WIP] Implement proper size calculation for RocksDBWrapper
feat(storage): RocksDBWrapper — Implement Proper Size Calculation (v1.8.0, #205)
Mar 15, 2026
…pace preservation test Co-authored-by: makr-code <[email protected]>
Copilot
AI
changed the title
feat(storage): RocksDBWrapper — Implement Proper Size Calculation (v1.8.0, #205)
feat(storage): RocksDBWrapper proper size calculation via SST property + /v1/admin/storage/stats endpoint (v1.8.0 #205)
Mar 15, 2026
makr-code
marked this pull request as ready for review
March 15, 2026 19:14
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.
RocksDBWrapper::getApproximateSize()returned a hardcoded0, making disk-space monitoring, compaction triggers, and admin storage metrics entirely unreliable.Changes
src/storage/rocksdb_wrapper.cppgetApproximateSize(): replaces TODO/0 withGetIntProperty("rocksdb.total-sst-files-size")(primary) andGetApproximateSizes(INCLUDE_FILES)range scan (fallback for builds where the property is unavailable)getStats(): addstotal_sst_files_size_bytesas the first field in the"rocksdb"JSON objectinclude/storage/disk_space_monitor.h+src/storage/disk_space_monitor.cppSpaceInfogainsuint64_t rocksdb_size_bytes = 0setRocksDBSize(uint64_t)persists the SST size intocurrent_info_undermutex_checkSpace()explicitly carriescurrent_info_.rocksdb_size_bytesinto the refreshedSpaceInfoso background monitoring loops don't zero it outsrc/server/http_server.cppGET /v1/admin/storage/stats(AdminStorageStatsGetroute)rocksdb_sst_size_bytes(top-level) +disksub-object with OS-level path/total/used/free/available/usage_percent from a one-shotDiskSpaceMonitor::checkSpace()tests/test_rocksdb_size_calculation.cpp(new, 7 tests)GetApproximateSizeIsNonZeroAfterFlushGetApproximateSizeIncreasesWithDataGetStatsJsonHasTotalSstFilesSizeKeySetRocksDBSizeReflectedInSpaceInfoSetRocksDBSizeDefaultsToZeroCheckSpacePreservesRocksDBSizeGetApproximateSizeReturnZeroWhenClosed.github/workflows/rocksdb-size-calculation-ci.yml(new)Matrix: gcc-12/clang-15 on Ubuntu 22.04, gcc-13 on Ubuntu 24.04.
src/storage/FUTURE_ENHANCEMENTS.mdAll three roadmap items marked
[x].Type of Change
Testing
📚 Research & Knowledge (wenn applicable)
/docs/research/angelegt?/docs/research/implementation_influence/eingetragen?Relevante Quellen:
Checklist
Original prompt
RocksDBWrapper: Implement Proper Size Calculation #4036🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.