Migration Error

Hi,

This happened after kafka on sentry filed up disk.
I had made these changes to my .env file Sentry disk cleanup [kafka] about a month back and that seemed to fix the problem (the kafka size dropped significantly).

Kafka filled up disk again on Sunday (the kafka volume took 80GB of space).
I bumped the disk space a bit and tried to run my older install.sh (master from about 12th Oct, I don’t have a commit hash) and it failed with something similar to the first error (the one with KafkaError{code=TOPIC_ALREADY_EXISTS).

I tried updating to the latest tag, and then to master but kept getting the same error along with the migration error snuba.migrations.errors.MigrationInProgress: transactions: 0008_transactions_add_timestamp_index.

After going through the docker compose yaml, and then the snuba code I found the migration commands which I posted above.

My best hunch is one of the the first install.sh runs tried to migrate and failed/errored out for some reason.
Once the state is marked in progress, it is not reverted even when you re-try the migration.
Some way to detect and mitigate or warn the user here would be nice.