Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate catalogs with same name and storage location #1044

Open
pingtimeout opened this issue Feb 21, 2025 · 3 comments
Open

Duplicate catalogs with same name and storage location #1044

pingtimeout opened this issue Feb 21, 2025 · 3 comments
Labels
1.0-blocker bug Something isn't working

Comments

@pingtimeout
Copy link

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

@pingtimeout pingtimeout added the bug Something isn't working label Feb 21, 2025
@eric-maynard
Copy link
Contributor

Unfortunately the ALLOW_OVERLAPPING_CATALOG_URLS check is not transactional. We need better semantics around these checks; it's an important consideration as we look more closely at the persistence layer. cc @jbonofre @dennishuo

@snazy
Copy link
Member

snazy commented Feb 24, 2025

Related to #767

@snazy
Copy link
Member

snazy commented Feb 24, 2025

The problem is much worse - it is possible to create many catalogs with the same name (hence the related to #767)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1.0-blocker bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants