Skip to content

db/kv, db/migrations: drop the unused CodeCache table - #25463

Merged
AskAlexSharov merged 3 commits into
mainfrom
alex/drop_code_cache_table_39
Oct 30, 2026
Merged

AskAlexSharov merged 3 commits into
mainfrom
alex/drop_code_cache_table_39

Conversation

@AskAlexSharov

Copy link
Copy Markdown
Collaborator

#24181 removed the persistent code store but kept its table in existing chaindata; on a datadir from before that change it still holds about 4 GB that nothing reads. A migration now drops it.

#24181 removed the persistent code store but left its table in existing chaindata.
Copilot AI balanced review requested due to automatic review settings October 28, 2026 07:13

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues remain for the migration that removes the obsolete CodeCache table.

No open issues 🎉

What changed in this PR

Removes the unused CodeCache table left in existing chaindata after #24181 removed the persistent code store.

Changes:

  • Registers CodeCache as a deprecated table.
  • Adds and registers a migration to drop it.
  • Adds a regression test covering table removal and repeated execution.
File Description
db/​migrations/​migrations.go Registers the migration for the chain database.
db/​migrations/​migrations_test.go Tests removal of a populated table and safe repeated execution.
db/​migrations/​drop_code_cache_table.go Drops the table and records migration completion in the same transaction.
db/​kv/​tables.go Defines the legacy table name and adds it to the deprecated table list.

Review effort: Balanced

…table_39

# Conflicts:
#	db/migrations/migrations.go
Copilot AI balanced review requested due to automatic review settings October 29, 2026 08:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the migration removing the unused CodeCache table.

No open issues 🎉

Review effort: Balanced

SoarinSkySagar pushed a commit to SoarinSkySagar/erigon that referenced this pull request Oct 29, 2026
A chaindata with 1.6 GB of data and 7.4 GB free (after erigontech#25463 and
erigontech#25465) passes the bloat ratio but not the 10 GB minimum, so it is never
compacted. Ratio 3 and 5 GB free compact it once; normal prune churn
stays far below 3x the data.
@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Oct 30, 2026
…table_39

# Conflicts:
#	db/migrations/migrations_test.go
Copilot AI balanced review requested due to automatic review settings October 30, 2026 05:31

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues were identified for the change removing the unused persistent CodeCache table.

No open issues 🎉

Review effort: Balanced

@AskAlexSharov
AskAlexSharov added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit 39cba79 Oct 30, 2026
135 checks passed
@AskAlexSharov
AskAlexSharov deleted the alex/drop_code_cache_table_39 branch October 30, 2026 08:02
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.

3 participants