Commit db8affa
committed
Add disk space check before VACUUM to prevent failures
Problem:
- VACUUM INTO ran out of disk space (15GB volume, needed 18GB)
- Created partial frontpage_new.sqlite (5.5GB) before failing
- Left incomplete files requiring manual cleanup
Solution:
Add pre-flight disk space check:
- Calculates required space (~90% of current DB size)
- Checks available space using statfs
- Skips VACUUM if insufficient space
- Logs warning with specific space requirements
Example log output:
"Insufficient disk space for VACUUM - skipping"
free_space_gb=5.2
required_gb=9.0
db_size_gb=10.0
action="Increase volume size before next VACUUM"
Manual cleanup needed:
rm /data/frontpage_new.sqlite
rm /data/frontpage_new.sqlite-journal
fly volumes extend <volume-id> --size 25
After volume expansion, next Sunday's VACUUM will succeed.1 parent 7066ee4 commit db8affa
1 file changed
+29
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
10 | 11 | | |
11 | 12 | | |
12 | 13 | | |
| |||
539 | 540 | | |
540 | 541 | | |
541 | 542 | | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
542 | 571 | | |
543 | 572 | | |
544 | 573 | | |
| |||
0 commit comments