FixProjectRecordsWithInvalidVisibility migration times out
While deploying 8.14-rc2 to staging the deploy failed because the following SQL statement failed with PG::QueryCanceled: ERROR: canceling statement due to statement timeout
for the migration db/post_migrate/20161109150329_fix_project_records_with_invalid_visibility.rb
:
UPDATE "projects" SET "visibility_level" = (SELECT "namespaces"."visibility_level" FROM "namespaces" WHERE "namespaces"."id" = "projects"."namespace_id") WHERE "projects"."id" IN (SELECT "projects"."id" FROM (SELECT "projects"."id" FROM "projects" INNER JOIN "namespaces" ON "projects"."namespace_id" = "namespaces"."id" WHERE "projects"."visibility_level" > "namespaces"."visibility_level" LIMIT 1000) AS projects_inner)
Do we disable_statement_timeout
or is there some improvement to be made in the query?