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

[Bug report] Cannot found catalog after repeat creation #5082

Closed
mchades opened this issue Oct 10, 2024 · 1 comment · Fixed by #5084
Closed

[Bug report] Cannot found catalog after repeat creation #5082

mchades opened this issue Oct 10, 2024 · 1 comment · Fixed by #5084
Assignees
Labels
0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 bug Something isn't working

Comments

@mchades
Copy link
Contributor

mchades commented Oct 10, 2024

Version

main branch

Describe what's wrong

we can modify the testDropCatalog() in CatalogIT class to describe the problem:

@Test
  public void testDropCatalog() {
    String catalogName = GravitinoITUtils.genRandomName("catalog");
    Assertions.assertFalse(metalake.catalogExists(catalogName));

    Map<String, String> properties = Maps.newHashMap();
    properties.put("metastore.uris", hmsUri);
    Catalog catalog =
        metalake.createCatalog(
            catalogName, Catalog.Type.RELATIONAL, "hive", "catalog comment", properties);
    Assertions.assertTrue(metalake.catalogExists(catalogName));
    Assertions.assertEquals(catalogName, catalog.name());

    Assertions.assertThrows(
        CatalogAlreadyExistsException.class, () -> metalake.createCatalog(
            catalogName, Catalog.Type.RELATIONAL, "hive", "catalog comment", properties));
    Assertions.assertTrue(metalake.catalogExists(catalogName));

    Assertions.assertTrue(metalake.dropCatalog(catalogName), "catalog should be dropped");
    Assertions.assertFalse(metalake.dropCatalog(catalogName), "catalog should be non-existent");
  }

the assertion will failed at:

Assertions.assertTrue(metalake.dropCatalog(catalogName), "catalog should be dropped");

Error message and/or stacktrace

catalog should be dropped
Expected :true
Actual :false

org.opentest4j.AssertionFailedError: catalog should be dropped ==> expected: but was:

How to reproduce

follow above describtion

Additional context

the load operation before drop can successfully because the catalog cache

@mchades mchades added the bug Something isn't working label Oct 10, 2024
@mchades
Copy link
Contributor Author

mchades commented Oct 10, 2024

@yuqi1129 Please help take a look.

@mchades mchades self-assigned this Oct 10, 2024
@mchades mchades added 0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 labels Oct 10, 2024
github-actions bot pushed a commit that referenced this issue Oct 10, 2024
### What changes were proposed in this pull request?

 - not clean catalog if catalog already exists

### Why are the changes needed?

we will clean the catalog when the creation fails, but if the catalog
already exists it will also be dropped which is unexpected.

Fix: #5082 

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

tests added
mchades added a commit that referenced this issue Oct 10, 2024
### What changes were proposed in this pull request?

 - not clean catalog if catalog already exists

### Why are the changes needed?

we will clean the catalog when the creation fails, but if the catalog
already exists it will also be dropped which is unexpected.

Fix: #5082 

### Does this PR introduce _any_ user-facing change?

no

### How was this patch tested?

tests added

Co-authored-by: mchades <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0.6.1 Release v0.6.1 0.7.0 Release v0.7.0 bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant