Open DaedalusG opened 8 months ago
^^ as noted above
pid | usename | blocked_by | blocked_query
--------+---------------------------------------------------+------------+----------------------------------------------------------------
297341 | src-a673939d002d7566@src-69349f75ded403c7eeae.iam | {292817} | -- query hash: 2664355207 +
| | | -- query length: 142 (0 args) +
| | | -- (could not infer source) +
| | | CREATE INDEX CONCURRENTLY IF NOT EXISTS idx_repo_gitlab_topics+
| | | ON repo +
| | | USING GIN((metadata->'topics')) +
| | | WHERE external_service_type = 'gitlab';
Here again we have a long running query blocking the application of the up
migrations to be applied during startup
Internal Lin to another occurrence: https://sourcegraph.slack.com/archives/C0411GPJQTB/p1713201791701729
Another one (same migration): https://sourcegraph.slack.com/archives/C0411GPJQTB/p1713210415282729
In the 5.2 release Sourcegraph internal deployments failed to upgrade on the following migration during a standard/rolling upgrade:
Generally its observed that queries failing in this way are CREATE INDEX CONCURRENTLY operations
The issue appears to be migrator entering into a state in which a migration takes a table lock and then gets stuck in ctx, not executing an index creation or releasing the lock. The workaround is to manually terminate the transaction holding the lock.
This issue so far has only been consistently encountered in Sourcegraph deployments with extensive use of scip and auto-indexing features
Expected and Actual behavior:
The database connection shouldn't hang leaving migrator essentially stuck, and subject to potential timeouts. Migrator should have a way of detecting hanging transactions and auto resolving.
If you would like immediate help on this, please email support@sourcegraph.com (you can still create the issue, but there are no SLAs on issues like there are for support requests).