Skip to content

Commit caa8de3

Browse files
committed
fix(coderd): remove CREATE INDEX CONCURRENTLY from migrations
This seems to cause deadlocks with parallel migrations, which is why migrations seem to fail with multiple coderds. ``` coder-db-1 | 2023-07-06 20:15:04.322 UTC [90] ERROR: deadlock detected coder-db-1 | 2023-07-06 20:15:04.322 UTC [90] DETAIL: Process 90 waits for ExclusiveLock on advisory lock [16384,0,4187539795,1]; blocked by process 89. coder-db-1 | Process 89 waits for ShareLock on virtual transaction 4/15; blocked by process 90. coder-db-1 | Process 90: SELECT pg_advisory_lock($1) coder-db-1 | Process 89: CREATE INDEX CONCURRENTLY workspace_resources_job_id_idx ON workspace_resources USING btree (job_id); coder-db-1 | coder-db-1 | 2023-07-06 20:15:04.322 UTC [90] HINT: See server log for query details. coder-db-1 | 2023-07-06 20:15:04.322 UTC [90] STATEMENT: SELECT pg_advisory_lock($1) ```
1 parent 5bb6bc5 commit caa8de3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
CREATE INDEX CONCURRENTLY workspace_resources_job_id_idx ON workspace_resources USING btree (job_id);
1+
CREATE INDEX workspace_resources_job_id_idx ON workspace_resources USING btree (job_id);

0 commit comments

Comments
 (0)