-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Description:
Create a repair tool that can:
- detect corrupted files in the repository (especially indexes and backup manifests)
- automatically restore valid versions from redundant copies when available
This command is meant to be the practical “fix it” companion to gib check #6
Why:
Users need a straightforward way to recover from corruption without manually digging through objects. Since we plan to store redundant copies for critical files, we should use them automatically.
Proposed CLI:
gib repair --storage <name> --key <repo>Proposed behavior:
-
Run the same validations as
gib check -
For each detected corrupted/missing file:
-
If it is a critical file with a copy:
- Validate the copy (checksum/parse)
- Replace the corrupted primary with the copy
-
If primary is valid but copy is corrupted:
- Regenerate the copy from primary
-
If both are corrupted/missing:
- Report as unrecoverable
-
What counts as “corrupted”:
- Fails checksum (checksums are stored)
- Fails parsing / schema validation
- Truncated / malformed data
- Unexpected version/magic bytes
Targets:
indexes/chunks↔indexes/chunks.bakindexes/backups↔indexes/backups.bakbackups/<hash>↔backups/<hash>.bak
Safety:
- Default mode should create an “audit log” of all changes and print a summary
- Always keep at least one known-good file (e.g., if replacing, move old to
*.corrupt.<timestamp>when possible)
Acceptance Criteria:
gib repaircan fix:- missing primary when copy exists
- corrupted primary when copy is valid
- missing/corrupted copy when primary is valid
- Produces clear output and stable exit codes
- Works on both local and S3 storage backends
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request