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

Skip dropping testing Glue database when create time is within threshold #19101

Merged
merged 1 commit into from
Sep 20, 2023

Conversation

ebyhr
Copy link
Member

@ebyhr ebyhr commented Sep 20, 2023

Description

I suppose TestDatabricksWithGlueMetastoreCleanUp affected TestIcebergGlueCatalogAccessOperations.
There were many Glue DeleteDatabase calls in CloudTrail when TestIcebergGlueCatalogAccessOperations was running.

Fixes #19100

Release notes

(x) This is not user-visible or is docs only, and no release notes are required.

@ebyhr ebyhr added test no-release-notes This pull request does not require release notes entry labels Sep 20, 2023
@ebyhr ebyhr self-assigned this Sep 20, 2023
@cla-bot cla-bot bot added the cla-signed label Sep 20, 2023
@ebyhr ebyhr requested review from findepi and findinpath September 20, 2023 04:04
@ebyhr ebyhr force-pushed the ebi/delta-cleanup-schema branch from 8f18f51 to 0ffb20d Compare September 20, 2023 04:14
@ebyhr ebyhr changed the title Skip dropping testing Glue database when create time is before threshold Skip dropping testing Glue database when create time is within threshold Sep 20, 2023
try {
onTrino().executeQuery("DROP SCHEMA IF EXISTS " + schema);
log.info("Dropped schema %s", schema);
if (createTime.isBefore(SCHEMA_CLEANUP_THRESHOLD)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are not going to delete the schema, we should also abstain from deleting tables in that schema

@ebyhr ebyhr force-pushed the ebi/delta-cleanup-schema branch from 0ffb20d to 32f2fff Compare September 20, 2023 08:15
@ebyhr ebyhr requested a review from findepi September 20, 2023 10:03
@@ -69,6 +71,12 @@ public void testCleanUpOldTablesUsingDelta()

private void cleanSchema(String schema, long startTime, AWSGlueAsync glueClient)
{
Database database = glueClient.getDatabase(new GetDatabaseRequest().withName(schema)).getDatabase();
if (database.getCreateTime().toInstant().isAfter(SCHEMA_CLEANUP_THRESHOLD)) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit, pre-existing, SCHEMA_CLEANUP_THRESHOLD shouldn't be a static constant
it doesn't matter when class was loaded in current JVM. it matters when cleanup code was invoked.

@ebyhr ebyhr merged commit 8c460fd into master Sep 20, 2023
@ebyhr ebyhr deleted the ebi/delta-cleanup-schema branch September 20, 2023 13:27
@github-actions github-actions bot added this to the 427 milestone Sep 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed no-release-notes This pull request does not require release notes entry test
Development

Successfully merging this pull request may close these issues.

Flaky TestIcebergGlueCatalogAccessOperations
3 participants