-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Conversation
8f18f51
to
0ffb20d
Compare
try { | ||
onTrino().executeQuery("DROP SCHEMA IF EXISTS " + schema); | ||
log.info("Dropped schema %s", schema); | ||
if (createTime.isBefore(SCHEMA_CLEANUP_THRESHOLD)) { |
There was a problem hiding this comment.
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
0ffb20d
to
32f2fff
Compare
@@ -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)) { |
There was a problem hiding this comment.
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.
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.