#36292 index: Delete old coinstats index directory on startup
| Reviewability | Reviews | Agreement | Size | ||||
|---|---|---|---|---|---|---|---|
| #36292 index: Delete old coinstats index directory on startup | Ready | 1 | Positive | 14 + 2 tests | |||
|
|
|
| ||||
Reviewability: ReadyStalePaused Agreement: StrongPositivePositive w/ caveatsNeutralMildDisputedBlockedCrickets Reviews: current code-review ACKs, then (+stale ACKs) and -NACKs; greener = more ACKs. Size: lines added or modified outside tests, then in tests; greener = smaller. | |||||||
Goal
Deletes the obsolete `indexes/coinstats` database directory automatically on startup when `-coinstatsindex` is enabled. The old directory was left intact in v30 to allow nodes to downgrade to v29 without having to rebuild the index. With v29 reaching end-of-life, the database is now destroyed and removed if found.
Problem: Nodes upgraded from v29 or earlier retain the legacy `indexes/coinstats` directory indefinitely unless manually deleted, wasting disk space even though the active index resides in `indexes/coinstatsindex`.
Evidence of importance:
- A code comment in `coinstatsindex.cpp` scheduled this cleanup: '// TODO: Change this to deleting the old index with v31.'
- PR description: 'coinstatsindex was updated in an incompatible way in v30 (see #30469) and moved to the indexes/coinstatsindex folder... Since v32 branch-off has happened, this would now ship in v33. By then 29.x should be EOL assuming we are not going to release a v29.5.'
Reviewability
Ready
Nothing known that would invalidate a review now.
Waiting on (from the thread read):
- nothing: no pending requests or open questions
Agreement
Positive
support without stated reasons, no open objection (mzumsande, sedited)
Thread notes: bartoli asked whether deleting the old index before creating the new one was risky; fjahr clarified that the new index does not rely on the old data, answering the question.
Objections, suggestions, and questions: none recorded.
Support:
- mzumsande (member) (Concept ACK, 2026-09-17): (no reason given) [not substantive]
- sedited (member) (ACK, 2026-09-18): (no reason given) [not substantive]
Participants:
- mzumsande (member, support, 1 statements 2026-09-17 to 2026-09-17): Concept ACK
- sedited (member, support, 1 statements 2026-09-18 to 2026-09-18): ACK
- bartoli (none, question, 1 statements 2026-09-23 to 2026-09-23): asked whether deleting the old index directory before creating the new one was risky
Files
3 lines under test/bench/ci.
- src/index/coinstatsindex.cpp +7/-5
- doc/release-notes-coinstatsindex-cleanup.md +7/-0
- test/functional/feature_coinstatsindex_compatibility.py +2/-1
Card
The short text the ranking pass compares across PRs.
Automatically deletes the obsolete legacy coinstats index directory at indexes/coinstats on startup when -coinstatsindex is enabled. A format migration in v30 moved the active index to indexes/coinstatsindex while retaining the old folder to support downgrades to v29. With v29 reaching end-of-life, this scheduled cleanup reclaims disk space for users who had upgraded from older releases.
Data
thread read through 2026-09-23 (4 statements), head 82e4cc6964
Discussion read under schema 1 rules: suggestions and questions may be missing, and an objection may combine several harms (schema history).
labels: UTXO Db and Indexes
Categories
Indexes
P3 · cleanup
Automatically cleans up the legacy v29 `indexes/coinstats` directory to reclaim wasted disk space on upgraded nodes now that v29 is EOL. Resolves an explicit TODO scheduled for post-v29 lifecycle, providing useful housekeeping without affecting core index correctness or performance.
Membership: Modifies `src/index/coinstatsindex.cpp` and index functional tests.
Factors: security/stability 0, bug 0, performance 0, user value 1, leverage 0