Bug #19993
closedIncompatible with Postgresql 11
Description
2023-01-26_21:08:14.29202 ActiveRecord::StatementInvalid: PG::FeatureNotSupported: ERROR: FOR UPDATE is not allowed with GROUP BY clause 2023-01-26_21:08:14.29202 : SELECT MIN(uuid) AS uuid, COUNT(uuid) AS n FROM links 2023-01-26_21:08:14.29202 WHERE tail_uuid IS NOT NULL 2023-01-26_21:08:14.29203 AND head_uuid IS NOT NULL 2023-01-26_21:08:14.29203 AND link_class = 'permission' 2023-01-26_21:08:14.29203 AND name in ('can_read', 'can_write', 'can_manage') 2023-01-26_21:08:14.29204 GROUP BY (tail_uuid, head_uuid) 2023-01-26_21:08:14.29204 HAVING COUNT(uuid) > 1 2023-01-26_21:08:14.29204 FOR UPDATE
This is with Debian postgresql 11+200+deb10u5, which is the default version on Debian 10.
Ubuntu 18.04 has postgresql 10.22-0ubuntu0.18.04.1
Updated by Tom Clegg almost 2 years ago
Ah. Looks like this is coming from services/api/db/migrate/20221219165512_dedup_permission_links.rb during migration.
Updated by Tom Clegg almost 2 years ago
There are no consequences of removing "FOR UPDATE" unless there is still activity on other RailsAPI hosts while this host is upgrading/migrating. Given that row-locking is an experimental feature even after this migration, we're already accepting the race outcomes anyway.
So I think we should just remove the "FOR UPDATE" clause.
Updated by Tom Clegg almost 2 years ago
19993-groupby-forupdate @ b2a40b550fbe5bcf8ae6f05a1448f46d2f4510db -- developer-run-tests: #3463
Updated by Tom Clegg almost 2 years ago
- Assigned To set to Tom Clegg
- Status changed from New to In Progress
Updated by Tom Clegg almost 2 years ago
- Target version changed from Future to 2023-02-01 sprint
Updated by Peter Amstutz almost 2 years ago
Tom Clegg wrote in #note-5:
19993-groupby-forupdate @ b2a40b550fbe5bcf8ae6f05a1448f46d2f4510db -- developer-run-tests: #3463
This LGTM.
Updated by Tom Clegg almost 2 years ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|0acc3185deb4f2215f36dcbbe66ac24b4c0ecd4a.