Skip to content

Drop the legacy cache tables after the production purge - #198

Merged
stylessh merged 2 commits into
mainfrom
diffkit/drop-legacy-cache-tables
Nov 8, 2026
Merged

stylessh merged 2 commits into
mainfrom
diffkit/drop-legacy-cache-tables

Conversation

@stylessh

@stylessh stylessh commented Nov 8, 2026 •

Copy link
Copy Markdown
Owner

Drops github_webhook_event, github_revalidation_signal, github_cache_namespace and github_response_cache. #193 removed them from the Drizzle schema, and nothing has read them since. This is the follow-up migration from platform-plan.md, Incidents.

Safe to merge: the production purge is complete. Deploys apply D1 migrations before the Worker ships, so this waited until the tables were empty.

Table Deleted Purge window (UTC, 2026-11-08)
github_webhook_event 31,989,462 (4,960,000 by the incident session, then 27,029,462) 03:08–03:33, then 05:36–11:00
github_revalidation_signal 6,004,294 11:00–12:07
github_cache_namespace 6,001,415 12:07–13:15
github_response_cache not purged: 67 rows, all written 03:10–03:21 before #193 deployed —
  • After the purge, SELECT rowid … LIMIT 1 returns no row for the three purged tables.
  • wrangler d1 info quickhub-db went from 8.35 GB at 05:34 UTC to 3.15 MB at 13:15 UTC.
  • The purge ran in 10k-row batches with a 6 s pause. At the briefed 20k rows / 4 s, about 12% of live webhook change-feed inserts hit D1 7429. At 10k / 6 s there were none.
  • A 60 s wrangler tail every 30 minutes showed no 5xx and no D1 errors, and /login returned 200 on every check.

migration-destructive: approved

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Removed legacy cache storage from the dashboard’s data layer. This maintenance change does not add dashboard features or alter the dashboard’s user-facing behavior.

…rge)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

This change adds a migration that documents how to check the four legacy cache tables and drops them with IF EXISTS.

Changes: Legacy cache table removal

Layer / File(s) Summary
Verify and drop legacy tables
apps/dashboard/drizzle/0007_drop_legacy_cache_tables.sql
Adds a D1 row-count query and instructs operators to verify the tables are empty after the production purge. Then drops the four tables with IF EXISTS.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

Possibly related PRs

  • stylessh/diffkit#193: Removes the declarations and code for these tables. This PR adds the deferred DROP migration.
Merge Risk: Low · up to 91218

The migration guidance may prompt an unnecessary purge or deployment delay. This is a bounded operational issue.

- [ ] Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@stylessh

stylessh commented Nov 8, 2026

Copy link
Copy Markdown
Owner Author

Heads-up from #203 (D1 migration gate): once it merges, PRs whose migrations contain DROP / ALTER … DROP COLUMN / TRUNCATE fail the D1 migrations check unless the PR body has a line migration-destructive: approved. This PR is the intended case: add that line when the purge is done and you're ready to merge. The check re-runs on body edits. It also reports that the legacy-table allowlist in scripts/check-d1-migrations.mjs can be removed after this lands.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@stylessh
stylessh merged commit b505dd9 into main Nov 8, 2026
8 of 9 checks passed
@stylessh
stylessh deleted the diffkit/drop-legacy-cache-tables branch November 8, 2026 13:20
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.

1 participant