Project

General

Profile

Actions

Bug #19993

closed

Incompatible with Postgresql 11

Added by Peter Amstutz about 1 year ago. Updated about 1 year ago.

Status:
Resolved
Priority:
Normal
Assigned To:
Category:
API
Target version:
Story points:
0.5
Release relationship:
Auto

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


Subtasks 1 (0 open1 closed)

Task #19994: Review 19993-groupby-forupdateResolvedTom Clegg01/27/2023Actions
Actions #1

Updated by Peter Amstutz about 1 year ago

  • Description updated (diff)
Actions #2

Updated by Peter Amstutz about 1 year ago

  • Description updated (diff)
Actions #3

Updated by Tom Clegg about 1 year ago

Ah. Looks like this is coming from services/api/db/migrate/20221219165512_dedup_permission_links.rb during migration.

Actions #4

Updated by Tom Clegg about 1 year 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.

Actions #6

Updated by Tom Clegg about 1 year ago

  • Assigned To set to Tom Clegg
  • Status changed from New to In Progress
Actions #7

Updated by Tom Clegg about 1 year ago

  • Target version changed from Future to 2023-02-01 sprint
Actions #8

Updated by Tom Clegg about 1 year ago

  • Story points set to 0.5
Actions #9

Updated by Peter Amstutz about 1 year ago

Tom Clegg wrote in #note-5:

19993-groupby-forupdate @ b2a40b550fbe5bcf8ae6f05a1448f46d2f4510db -- developer-run-tests: #3463

This LGTM.

Actions #10

Updated by Peter Amstutz about 1 year ago

  • Release set to 57
Actions #11

Updated by Tom Clegg about 1 year ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF