Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [3.6.4] - 2025-08-04
## Fixed
- Fixed ExpiredMetadataHandler s3 path cleanup issue on retry.

## [3.6.3] - 2025-07-28
## Added
- Added multiplatform support for beekeeper images. Added amd64 and arm64.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ private boolean cleanupPartition(
log.info("Cleaning up metadata for \"{}.{}\"", databaseName, tableName);
if (metadataCleaner.tableExists(client, databaseName, tableName)) {
boolean partitionDeleted = metadataCleaner.dropPartition(housekeepingMetadata, client);
if (partitionDeleted) {
if (partitionDeleted || housekeepingMetadata.getCleanupAttempts() > 0) {
pathCleaner.cleanupPath(housekeepingMetadata);
}
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,27 @@ public void typicalRunDroppingPartition() {
verify(beekeeperHistoryService).saveHistory(any(), eq(DELETED));
}

@Test
public void runDroppingPartition_retry() {
when(hiveClientFactory.newInstance()).thenReturn(hiveClient);
when(housekeepingMetadata.getDatabaseName()).thenReturn(DATABASE);
when(housekeepingMetadata.getTableName()).thenReturn(TABLE_NAME);
when(housekeepingMetadata.getPartitionName()).thenReturn(PARTITION_NAME);
when(housekeepingMetadata.getPath()).thenReturn(VALID_PARTITION_PATH);
when(housekeepingMetadata.getCleanupAttempts()).thenReturn(1);

when(hiveMetadataCleaner.dropPartition(Mockito.any(), Mockito.any())).thenReturn(false);
when(hiveMetadataCleaner.tableExists(hiveClient, DATABASE, TABLE_NAME)).thenReturn(true);

expiredMetadataHandler.cleanupMetadata(housekeepingMetadata, CLEANUP_INSTANCE, false);
verify(s3PathCleaner).cleanupPath(housekeepingMetadata);
verify(hiveMetadataCleaner, never()).dropTable(housekeepingMetadata, hiveClient);
verify(housekeepingMetadata).setCleanupAttempts(2);
verify(housekeepingMetadata).setHousekeepingStatus(DELETED);
verify(housekeepingMetadataRepository).save(housekeepingMetadata);
verify(beekeeperHistoryService).saveHistory(any(), eq(DELETED));
}

@Test
public void dontDropTableWithInvalidPath() {
when(hiveClientFactory.newInstance()).thenReturn(hiveClient);
Expand Down