Skip to content

wallet: preserve released migration indices - #9613

Open
vincenzopalazzo wants to merge 1 commit into
ElementsProject:masterfrom
vincenzopalazzo:fix/issue-9608-db-migration
Open

vincenzopalazzo wants to merge 1 commit into
ElementsProject:masterfrom
vincenzopalazzo:fix/issue-9608-db-migration

Conversation

@vincenzopalazzo

@vincenzopalazzo vincenzopalazzo commented Oct 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

  • v26.06.8 shipped the funding feerate repairs as database migrations 283 and 284. Current master inserted the new our_outputs / our_txs migrations before them, so an upgrade from v26.06.8 starts at migration 285, skips the table creation, and then fails in migrate_backfill_bwatch_tables with no such table: our_outputs. Fixes Database migration broken during migration to master #9608.
  • Keep the released migration prefix immutable by moving the feerate repairs back to indices 283 and 284. The new wallet migrations now start at 285.
  • Add test_v26_06_8_migrate, which recreates the released version-284 boundary and upgrades it to the current schema.
  • Update the existing stored-feerate migration test to recreate the pre-repair schema at version 282 before rerunning the now-correct migration sequence.

Test plan

  • gmake -j4 PYTHON=.venv/bin/python
  • ./wallet/test/run-db
  • pytest -vv tests/test_splicing.py::test_splice_stored_feerate_repaired_on_upgrade (4 cases)
  • test_v26_06_8_migrate aborts with the original master ordering and passes with this fix
  • pytest -vv tests/test_askrene.py::test_reserve (isolated retry after its unrelated parallel-suite regex failure)
  • CI

@vincenzopalazzo
vincenzopalazzo force-pushed the fix/issue-9608-db-migration branch 3 times, most recently from 905f324 to ed32907 Compare October 8, 2026 20:14
v26.06.8 shipped the funding feerate repairs as migrations 283 and
284. New wallet migrations were later inserted before them, so a node
upgrading from that release started at 285, skipped the new wallet
tables, and failed while backfilling them.

Keep the released migration prefix immutable by restoring the feerate
repairs to 283 and 284. Add test_v26_06_8_migrate at the released
version-284 boundary so later migrations cannot move ahead of it again.
Recreate the pre-repair schema in the existing feerate migration test so
later non-idempotent migrations can run from their proper boundaries.

Changelog-Fixed: wallet: upgrading from v26.06.8 no longer fails while backfilling the new wallet tables.
Fixes: ElementsProject#9608
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

Database migration broken during migration to master

1 participant