Uploaded image for project: 'FOLIO'
  1. FOLIO
  2. FOLIO-2447

Remove gen_random_uuid(), it fails in pgpool native replication

    XMLWordPrintable

    Details

    • Template:
      Standard Bug Write-Up Format
    • Sprint:
      CP: Non-roadmap backlog
    • Development Team:
      Core: Platform

      Description

      gen_random_uuid() creates a different UUID in each node of a replicated PostgreSQL environment when Pgpool-II is used in native replication mode.
      This has been reported for mod-configuration and Pgpool-II replication in #sys-ops on Slack. From the Pgpool-II manual:
      https://www.pgpool.net/docs/latest/en/html/restrictions.html

      There is no guarantee that any data provided using a context-dependent mechanism (e.g. random number, transaction ID, OID, SERIAL, sequence), will be replicated correctly on multiple backends.

      RMB documentation mentions it in the upgrading guide for RMB 25 and in connection with "generateId": https://github.com/folio-org/raml-module-builder/#the-post-tenant-api

      Tasks:

      After all modules have removed gen_random_uuid RMB and Spring base should add this function that takes precedence over the function from pgcrypto:

      CREATE OR REPLACE FUNCTION public.gen_random_uuid() RETURNS uuid
      language plpgsql as $$
      BEGIN
        RAISE 'FOLIO doesn''t allow gen_random_uuid() because it doesn''t work with a replicated database like Pgpool-II'
          USING ERRCODE = 'feature_not_supported';
      END;
      $$;

      Note:

      Pgpool-II streaming replication mode is NOT affected by this issue, only Pgpool-II native replication mode.

        TestRail: Results

          Attachments

            Issue Links

              Activity

                People

                Assignee:
                julianladisch Julian Ladisch
                Reporter:
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                  Dates

                  Created:
                  Updated:

                    TestRail: Runs

                      TestRail: Cases