Incident Library

IL-0570 CrowdWorks · 2026-09-07 (published)database

Dropping an unused MySQL table stalled queries on its busy parent table and crowdworks.jp was hard to reach for a minute

The cause was a MySQL metadata lock (MDL). The dropped table had a foreign key to a table with very heavy traffic, and to keep foreign keys consistent MySQL requests an exclusive MDL on the parent table even when the child table is dropped. The migration waited to get that exclusive lock, and queries to the parent table queued up behind it, which the team considers the direct cause. The service's lock_wait_timeout was set to 50 seconds by default; the migration eventually failed on the timeout and the service recovered by itself. As prevention, CrowdWorks decided that such migrations set lock_wait_timeout = 3 for their session, so that a migration that cannot get the lock fails after 3 seconds. The team also considered the strong_migrations gem, which detects dangerous migrations, and a monkey patch that forces a short timeout on every migration, but DDL on specific high-traffic tables is rare and the extra dependency and maintenance were not judged worth it, so the rule is spread through documentation, AI review instructions and automatic pull request comments, agreed as an ADR (Architecture Decision Record).

Severity
–
Scope
crowdworks.jp was hard to reach for about a minute
Users affected
–
Region
–
Time to detect
–
Time to resolve
1m

Symptoms

Right after a deploy ran a migration with drop_table to remove a table that was no longer used, database queries started to pile up and crowdworks.jp was hard to reach for about a minute. The migration finally failed on a timeout and the service recovered on its own.

Symptom Lock contention or deadlockIntermittent connection failures

Root cause

Root cause Faulty deployment

Contributing factor –
Trigger
An engineer's deploy ran a migration that used drop_table to delete a table no longer in use.

Detection

–

Remediation

–

Action items

Lessons

–

Sources

Related cases

Check your cluster for this

kubegap audits a Kubernetes cluster for conditions like the ones in this case, Database, Schema migration among them, read-only, from Claude Code or Codex. Its checks cite public reports like this one.

For AI tools and scripts

The API needs no key. The MCP server offers search_incidents, get_incident, list_incidents, get_topic and vocab; both are explained on API and MCP.