mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 18:11:48 +00:00
We hit a deadlock when deploying this migration to s2. This is because within our transaction of the migration we likely didn't obtain table locks in the same order as a transaction in our application code. So this commit introduces a new migration metadata field "noTransaction". The documentation for migrator says you should create a migration per needed transactions. However, this would require us to create 100s of migrations. We believe the better approach is introducing this field and barely advertising it. When reading the code which actually runs migrations, there is no extra logic done outside of BEGIN; run_migration; COMMIT; so this change is safe. We update the migrations to avoid duplicating the function name we introduce in case something goes wrong (now that the transaction could leak out the function name). Test Plan: The actual migrations are tested by go test. I added a test assertion that we don't call Transact, but to be honest that is super sketchy. However, we couldn't actually find any test fixtures which actually run against the DB. So that would require a much deeper investment for how simple the code change is. Co-authored-by: Erik Seliger <erikseliger@me.com> |
||
|---|---|---|
| .. | ||
| _resources | ||
| admin | ||
| cli/references | ||
| dev | ||
| _generated.push.sh | ||
| BUILD.bazel | ||
| CHANGELOG.md | ||
| CODENOTIFY | ||
| dependency_decisions.yml | ||
| docsite.json | ||
| index.md | ||
| KNOWN-ISSUES.md | ||
| serve.sh | ||
| sidebar.md | ||
| test.sh | ||