Uploaded image for project: 'folio-spring-base'
  1. folio-spring-base
  2. FOLSPRINGB-86

Enabling two tenants in parallel fails

    XMLWordPrintable

Details

    • Core: Platform
    • Orchid (R1 2023)
    • TBD

    Description

      How to reproduce:

      # setup the DB_* env vars to point to an empty database
      git checkout v1.2.0
      mvn clean install
      java -jar target/mod-tags-1.2.0.jar
      

      In a second shell:

      (curl -HX-Okapi-Tenant:tenant1 -HContent-type:application/json -d '{"module_to":"mod-tags-1.2.0"}' http://localhost:8081/_/tenant &) ; (curl -HX-Okapi-Tenant:tenant2 -HContent-type:application/json -d '{"module_to":"mod-tags-1.2.0"}' http://localhost:8081/_/tenant &)
      

      Expected result:

      Both tenants are successfully enabled in parallel.

      Actual result:

      16:17:50 [] [tenant2] [] [mod-tags] INFO  TenantController     Upgrading tenant...
      16:17:50 [] [tenant2] [] [mod-tags] INFO  TenantController     Upgrading tenant...
      16:17:50 [] [tenant2] [] [mod-tags] INFO  TenantService        About to start liquibase update for tenant [tenant2]
      16:17:50 [] [tenant2] [] [mod-tags] INFO  TenantService        About to start liquibase update for tenant [tenant1]
      org.postgresql.util.PSQLException: ERROR: duplicate key value violates unique constraint "pg_namespace_nspname_index"
        Detail: Key (nspname)=(tenant1_mod_tags) already exists.
      

      Note the line where "[tenant2]" is at the beginning and "for tenant [tenant1]" is at the end.

      Credits

      Florian Gleixner has reported this bug on #development Slack channel.

      TestRail: Results

        Attachments

          Issue Links

            Activity

              People

                julianladisch Julian Ladisch
                julianladisch Julian Ladisch
                Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                  Created:
                  Updated:
                  Resolved:

                  TestRail: Runs

                    TestRail: Cases