-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Description
The watermark parsing logic in _parse_watermark_percentage
method within cratedb_toolkit/admin/xmover/analysis/shard.py
needs improvement to handle edge cases properly.
Problem
Currently, the function doesn't handle:
- Negative percentage values
- Percentage values greater than 100%
- Invalid input that could cause parsing errors
This could lead to incorrect watermark calculations and potential issues in shard analysis.
Proposed Solution
Add validation to:
- Clamp values to valid range (0.0-100.0%)
- Log warnings for invalid values
- Return sensible defaults (85.0%) for invalid input
- Handle ValueError exceptions from float conversion
Context
This improvement was identified during code review of PR #523.
References:
- PR: Admin/XMover: Add CrateDB shard analyzer and movement tool #523
- Comment: Admin/XMover: Add CrateDB shard analyzer and movement tool #523 (comment)
- Requested by: @amotl
Files to modify
cratedb_toolkit/admin/xmover/analysis/shard.py
(lines ~682-700)
Metadata
Metadata
Assignees
Labels
No labels