Skip to content

Add disk space checking before compaction operations - #1

Draft
bpatelcs wants to merge 1 commit into
mainfrom
bhavik.patel/compaction-disk-check
Draft

Add disk space checking before compaction operations#1
bpatelcs wants to merge 1 commit into
mainfrom
bhavik.patel/compaction-disk-check

Conversation

@bpatelcs

Copy link
Copy Markdown
Owner

Summary

Intent:

  • Prevent compaction operations from failing due to insufficient disk space
  • Avoid potential data loss or system instability from failed compaction attempts
  • Enable proactive monitoring and alerting for disk space issues

Changes:

  • Added spaceMultiplier field to Plan class to encapsulate strategy-specific space requirements
  • Introduced Environment dependency injection through TSDBPlugin → TSDBEngineFactory → TSDBEngine → ClosedChunkIndexManager
  • Implemented hasSufficientDiskSpace() method with overflow protection and specific exception handling
  • Configured space multipliers per strategy: SizeTieredCompaction (2.0x), ForceMergeCompaction (0.3x), NoopCompaction (0.0x)
  • Enhanced logging with comprehensive diagnostic context (strategy, indexes count, space calculations, paths)
  • Added input validation to reject negative space multipliers

Test Plan

  • Ran ./gradlew build - all tests pass
  • Verified space calculation logic handles edge cases (empty plans, null environment, overflow scenarios)
  • Existing test suite covers compaction workflows with the new disk space checks

Issues

Summary:
Intent:
- Prevent compaction operations from failing due to insufficient disk space
- Avoid potential data loss or system instability from failed compaction attempts
- Enable proactive monitoring and alerting for disk space issues

Changes:
- Added `spaceMultiplier` field to Plan class to encapsulate strategy-specific space requirements
- Introduced Environment dependency injection through TSDBPlugin → TSDBEngineFactory → TSDBEngine → ClosedChunkIndexManager
- Implemented `hasSufficientDiskSpace()` method with overflow protection and specific exception handling
- Configured space multipliers per strategy: SizeTieredCompaction (2.0x), ForceMergeCompaction (0.3x), NoopCompaction (0.0x)
- Enhanced logging with comprehensive diagnostic context (strategy, indexes count, space calculations, paths)
- Added input validation to reject negative space multipliers

Test Plan:
- Ran `./gradlew build` - all tests pass
- Verified space calculation logic handles edge cases (empty plans, null environment, overflow scenarios)
- Existing test suite covers compaction workflows with the new disk space checks

Jira Issues:

---

<sub>Generated by the 🪄 [pr-create](https://sg.uberinternal.com/code.uber.internal/uber-code/devexp-agent-marketplace/-/blob/claude-code/plugins/dev/uber-dev/skills/pr-create/SKILL.md) skill in devexp-agent-marketplace</sub>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant