Skip to content

Duplicate catalogs with same name and storage location #1044

@pingtimeout

Description

@pingtimeout

Describe the bug

There is a race condition that makes it possible to create multiple catalogs with the same name and the same storage location.

To Reproduce

  • Check out this commit: pingtimeout@5eae99a
  • Run the server using the getting-started docker compose file: docker compose -f getting-started/eclipselink/docker-compose.yml up
  • Export the client ID and secrets as environment variables: export CLIENT_ID=root CLIENT_SECRET=s3cr3t
  • Run ./gradlew :polaris-benchmarks:gatlingRun

The Gatling simulation runs many different users that first authenticate against the oauth API and then create a catalog with the name Catalog and the storage location /tmp/polaris2.

Actual Behavior

The Gatling output contains the number of successful catalog creation requests. In the example below, 21 of them succeeded:

========================================================================================================================
2025-02-21 16:44:42 UTC                                                                               3s elapsed
---- Requests -----------------------------------------------------------------------|---Total---|-----OK----|----KO----
> Global                                                                             |     1,399 |       221 |     1,178
> Authenticate                                                                       |       200 |       200 |         0
> Create Catalog                                                                     |     1,199 |        21 |     1,178

Expected Behavior

Given that ALLOW_OVERLAPPING_CATALOG_URLS is set to false (the default value), only one catalog creation should succeed. And the /api/management/v1/catalogs endpoint should only list two catalogs: the one created by the docker compose file and the one created by Gatling.

Additional context

This file is the output from GET /api/management/v1/catalogs. It shows that 21 catalogs have been created with the same name and storage location. Some of them have the same creation timestamp, some don't.

I would say the issue is reproducible about 50% of the time.

System information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions