From 7dc78323dc58ecf3d5ed5641edb84685bb536728 Mon Sep 17 00:00:00 2001 From: Venu Reddy Date: Tue, 31 Mar 2026 19:51:15 +0530 Subject: [PATCH 1/2] HIVE-29528: Cleanup managed DB dir after async drop --- .../hive/ql/txn/compactor/CleanupRequest.java | 24 +++++++++++++++++ .../hive/ql/txn/compactor/FSRemover.java | 27 ++++++++++++++++--- .../compactor/handler/CompactionCleaner.java | 2 ++ .../api/hive_metastoreConstants.java | 2 ++ .../hive/metastore/AcidEventListener.java | 11 ++++++++ .../handler/DropDatabaseHandler.java | 5 ++++ .../txn/entities/CompactionInfo.java | 10 +++++++ 7 files changed, 78 insertions(+), 3 deletions(-) diff --git a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java index badfaeaf2832..86163acbc192 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java @@ -30,6 +30,8 @@ public class CleanupRequest { private final String location; private final List obsoleteDirs; private final boolean purge; + private final boolean softDelete; + private final boolean sourceOfReplication; private final String runAs; private final String dbName; private final String fullPartitionName; @@ -38,6 +40,8 @@ public CleanupRequest(CleanupRequestBuilder builder) { this.location = builder.location; this.obsoleteDirs = builder.obsoleteDirs; this.purge = builder.purge; + this.softDelete = builder.isSoftDelete; + this.sourceOfReplication = builder.sourceOfReplication; this.runAs = builder.runAs; this.dbName = builder.dbName; this.fullPartitionName = builder.fullPartitionName; @@ -55,6 +59,14 @@ public boolean isPurge() { return purge; } + public boolean isSoftDelete() { + return softDelete; + } + + public boolean isSourceOfReplication() { + return sourceOfReplication; + } + public String runAs() { return runAs; } @@ -74,6 +86,8 @@ public static class CleanupRequestBuilder { private String location; private List obsoleteDirs; private boolean purge; + private boolean isSoftDelete; + private boolean sourceOfReplication; private String runAs; private String dbName; private String fullPartitionName; @@ -93,6 +107,16 @@ public CleanupRequestBuilder setPurge(boolean purge) { return this; } + public CleanupRequestBuilder setSoftDelete(boolean softDelete) { + this.isSoftDelete = softDelete; + return this; + } + + public CleanupRequestBuilder setSourceOfReplication(boolean sourceOfReplication) { + this.sourceOfReplication = sourceOfReplication; + return this; + } + public CleanupRequestBuilder setDbName(String dbName) { this.dbName = dbName; return this; diff --git a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java index 82231d30d4e0..1b0070ed9286 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java @@ -17,8 +17,10 @@ */ package org.apache.hadoop.hive.ql.txn.compactor; +import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hive.common.AcidConstants; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.ReplChangeManager; import org.apache.hadoop.hive.metastore.api.Database; @@ -99,17 +101,18 @@ private List removeFiles(CleanupRequest cr) LOG.info("About to remove {} obsolete directories from {}. {}", cr.getObsoleteDirs().size(), cr.getLocation(), CompactorUtil.getDebugInfo(cr.getObsoleteDirs())); boolean needCmRecycle; + Database db = null; try { - Database db = metadataCache.computeIfAbsent(cr.getDbName(), + db = metadataCache.computeIfAbsent(cr.getDbName(), () -> CompactorUtil.resolveDatabase(conf, cr.getDbName())); needCmRecycle = ReplChangeManager.isSourceOfReplication(db); } catch (NoSuchObjectException ex) { // can not drop a database which is a source of replication - needCmRecycle = false; + needCmRecycle = cr.isSourceOfReplication(); } catch (RuntimeException ex) { if (ex.getCause() instanceof NoSuchObjectException) { // can not drop a database which is a source of replication - needCmRecycle = false; + needCmRecycle = cr.isSourceOfReplication(); } else { throw ex; } @@ -126,6 +129,24 @@ private List removeFiles(CleanupRequest cr) deleted.add(dead); } } + removeDatabaseDirIfNecessary(db, cr, fs); return deleted; } + + private void removeDatabaseDirIfNecessary(Database db, CleanupRequest cr, FileSystem fs) throws IOException { + if (db != null || !cr.isSoftDelete()) { + return; + } + Path databasePath = new Path(cr.getLocation()).getParent(); + for (FileStatus status : fs.listStatus(databasePath)) { + if (status.isDirectory() && + status.getPath().getName().matches("(.*)" + AcidConstants.SOFT_DELETE_TABLE_PATTERN)) { + return; + } + } + if (cr.isSourceOfReplication()) { + replChangeManager.recycle(databasePath, ReplChangeManager.RecycleType.MOVE, cr.isPurge()); + } + FileUtils.deleteDir(fs, databasePath, cr.isPurge(), conf); + } } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java index fd49bbb90f13..519957b06f11 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/handler/CompactionCleaner.java @@ -286,6 +286,8 @@ private CleanupRequest getCleaningRequestBasedOnLocation(CompactionInfo ci, Stri .setFullPartitionName(ci.getFullPartitionName()) .setRunAs(ci.runAs) .setPurge(ifPurge) + .setSoftDelete(ci.isSoftDelete()) + .setSourceOfReplication(ci.isSourceOfReplication()) .setObsoleteDirs(Collections.singletonList(obsoletePath)) .build(); } diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java index f5a102ab9647..dfa8ee51f2ed 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java @@ -93,6 +93,8 @@ public static final java.lang.String WRITE_ID = "writeId"; + public static final java.lang.String SOFT_DELETE_DATABASE = "soft_delete_db"; + public static final java.lang.String EXPECTED_PARAMETER_KEY = "expected_parameter_key"; public static final java.lang.String EXPECTED_PARAMETER_VALUE = "expected_parameter_value"; diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java index 97d39d9473db..5096f7e4bd45 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java @@ -19,6 +19,7 @@ package org.apache.hadoop.hive.metastore; import org.apache.hadoop.conf.Configuration; +import org.apache.hadoop.hive.common.repl.ReplConst; import org.apache.hadoop.hive.metastore.api.CompactionRequest; import org.apache.hadoop.hive.metastore.api.CompactionType; import org.apache.hadoop.hive.metastore.api.Database; @@ -91,6 +92,7 @@ public void onDropTable(DropTableEvent tableEvent) throws MetaException { rqst.setRunas(TxnUtils.findUserToRunAs(table.getSd().getLocation(), table, conf)); rqst.putToProperties("location", table.getSd().getLocation()); rqst.putToProperties("ifPurge", Boolean.toString(isMustPurge(tableEvent.getEnvironmentContext(), table))); + addSoftDeletePropertiesToRequest(tableEvent.getEnvironmentContext(), rqst); txnHandler.submitForCleanup(rqst, table.getWriteId(), currentTxn); } catch (InterruptedException | IOException e) { throwMetaException(e); @@ -244,4 +246,13 @@ private long getTxnId(EnvironmentContext context) { .map(Long::parseLong) .orElse(0L); } + + private void addSoftDeletePropertiesToRequest(EnvironmentContext context, CompactionRequest request) { + if ("true".equalsIgnoreCase(context.getProperties().get(hive_metastoreConstants.SOFT_DELETE_DATABASE))) { + request.putToProperties(hive_metastoreConstants.SOFT_DELETE_DATABASE, Boolean.TRUE.toString()); + if ("true".equalsIgnoreCase(context.getProperties().get(ReplConst.SOURCE_OF_REPLICATION))) { + request.putToProperties(ReplConst.SOURCE_OF_REPLICATION, Boolean.TRUE.toString()); + } + } + } } diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java index 1a9805121605..70777da088e2 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java @@ -28,6 +28,7 @@ import java.util.concurrent.atomic.AtomicReference; import org.apache.hadoop.fs.Path; +import org.apache.hadoop.hive.common.repl.ReplConst; import org.apache.hadoop.hive.metastore.Batchable; import org.apache.hadoop.hive.metastore.HMSHandler; import org.apache.hadoop.hive.metastore.IHMSHandler; @@ -136,6 +137,10 @@ public DropDatabaseResult execute() throws TException, IOException { if (isSoftDelete) { context = new EnvironmentContext(); context.putToProperties(hive_metastoreConstants.TXN_ID, String.valueOf(request.getTxnId())); + context.putToProperties(hive_metastoreConstants.SOFT_DELETE_DATABASE, Boolean.TRUE.toString()); + if (ReplChangeManager.isSourceOfReplication(db)) { + context.putToProperties(ReplConst.SOURCE_OF_REPLICATION, Boolean.TRUE.toString()); + } request.setDeleteManagedDir(false); } DropTableRequest dropRequest = new DropTableRequest(name, table.getTableName()); diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java index e1c1f492bab8..6cf9bcdb9e44 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java @@ -19,8 +19,10 @@ import org.apache.commons.lang3.builder.ToStringBuilder; import org.apache.hadoop.hive.common.ValidCompactorWriteIdList; +import org.apache.hadoop.hive.common.repl.ReplConst; import org.apache.hadoop.hive.metastore.api.CompactionInfoStruct; import org.apache.hadoop.hive.metastore.api.CompactionType; +import org.apache.hadoop.hive.metastore.api.hive_metastoreConstants; import org.apache.hadoop.hive.metastore.api.MetaException; import org.apache.hadoop.hive.metastore.api.OptionalCompactionInfoStruct; import org.apache.hadoop.hive.metastore.api.TableValidWriteIds; @@ -368,4 +370,12 @@ public void setWriteIds(boolean hasUncompactedAborts, Set writeIds) { public boolean isAbortedTxnCleanup() { return type == CompactionType.ABORT_TXN_CLEANUP; } + + public boolean isSoftDelete() { + return "true".equalsIgnoreCase(getProperty(hive_metastoreConstants.SOFT_DELETE_DATABASE)); + } + + public boolean isSourceOfReplication() { + return "true".equalsIgnoreCase(getProperty(ReplConst.SOURCE_OF_REPLICATION)); + } } From 866a22b2eb6a23f8d640c589afc1cd60e189a116 Mon Sep 17 00:00:00 2001 From: Venu Reddy Date: Thu, 2 Apr 2026 19:43:21 +0530 Subject: [PATCH 2/2] Reworked for comments --- .../hive/ql/txn/compactor/CleanupRequest.java | 6 +++--- .../hadoop/hive/ql/txn/compactor/FSRemover.java | 14 ++++---------- .../org/apache/hadoop/hive/ql/TestTxnCommands.java | 9 ++++----- .../metastore/api/hive_metastoreConstants.java | 2 +- .../hive/metastore/utils/MetaStoreUtils.java | 5 +++++ .../hadoop/hive/metastore/AcidEventListener.java | 11 ++++++----- .../metastore/handler/DropDatabaseHandler.java | 3 ++- .../metastore/txn/entities/CompactionInfo.java | 4 ++-- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java index 86163acbc192..c5f1b483899d 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/CleanupRequest.java @@ -40,7 +40,7 @@ public CleanupRequest(CleanupRequestBuilder builder) { this.location = builder.location; this.obsoleteDirs = builder.obsoleteDirs; this.purge = builder.purge; - this.softDelete = builder.isSoftDelete; + this.softDelete = builder.softDelete; this.sourceOfReplication = builder.sourceOfReplication; this.runAs = builder.runAs; this.dbName = builder.dbName; @@ -86,7 +86,7 @@ public static class CleanupRequestBuilder { private String location; private List obsoleteDirs; private boolean purge; - private boolean isSoftDelete; + private boolean softDelete; private boolean sourceOfReplication; private String runAs; private String dbName; @@ -108,7 +108,7 @@ public CleanupRequestBuilder setPurge(boolean purge) { } public CleanupRequestBuilder setSoftDelete(boolean softDelete) { - this.isSoftDelete = softDelete; + this.softDelete = softDelete; return this; } diff --git a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java index 1b0070ed9286..0a23d6473696 100644 --- a/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java +++ b/ql/src/java/org/apache/hadoop/hive/ql/txn/compactor/FSRemover.java @@ -17,10 +17,8 @@ */ package org.apache.hadoop.hive.ql.txn.compactor; -import org.apache.hadoop.fs.FileStatus; import org.apache.hadoop.fs.FileSystem; import org.apache.hadoop.fs.Path; -import org.apache.hadoop.hive.common.AcidConstants; import org.apache.hadoop.hive.conf.HiveConf; import org.apache.hadoop.hive.metastore.ReplChangeManager; import org.apache.hadoop.hive.metastore.api.Database; @@ -138,15 +136,11 @@ private void removeDatabaseDirIfNecessary(Database db, CleanupRequest cr, FileSy return; } Path databasePath = new Path(cr.getLocation()).getParent(); - for (FileStatus status : fs.listStatus(databasePath)) { - if (status.isDirectory() && - status.getPath().getName().matches("(.*)" + AcidConstants.SOFT_DELETE_TABLE_PATTERN)) { - return; + if (FileUtils.isDirEmpty(fs, databasePath)) { + if (cr.isSourceOfReplication()) { + replChangeManager.recycle(databasePath, ReplChangeManager.RecycleType.MOVE, cr.isPurge()); } + FileUtils.deleteDir(fs, databasePath, cr.isPurge(), conf); } - if (cr.isSourceOfReplication()) { - replChangeManager.recycle(databasePath, ReplChangeManager.RecycleType.MOVE, cr.isPurge()); - } - FileUtils.deleteDir(fs, databasePath, cr.isPurge(), conf); } } diff --git a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands.java b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands.java index 118aaf51bb15..01dd3d51f5fa 100644 --- a/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands.java +++ b/ql/src/test/org/apache/hadoop/hive/ql/TestTxnCommands.java @@ -18,6 +18,7 @@ package org.apache.hadoop.hive.ql; import java.io.File; +import java.io.FileNotFoundException; import java.io.FileOutputStream; import java.io.IOException; import java.util.ArrayList; @@ -1827,11 +1828,9 @@ private void dropDatabaseCascadeNonBlocking() throws Exception { runCleaner(hiveConf); - stat = fs.listStatus(new Path(getWarehouseDir(), database + ".db"), - t -> t.getName().matches("(mv_)?" + tableName + "2" + SOFT_DELETE_TABLE_PATTERN)); - if (stat.length != 0) { - Assert.fail("Table data was not removed from FS"); - } + Assert.assertThrows(database + ".db directory should not exist", FileNotFoundException.class, () -> { + fs.listStatus(new Path(getWarehouseDir(), database + ".db")); + }); } @Test diff --git a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java index dfa8ee51f2ed..65ab1bf69c33 100644 --- a/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java +++ b/standalone-metastore/metastore-common/src/gen/thrift/gen-javabean/org/apache/hadoop/hive/metastore/api/hive_metastoreConstants.java @@ -93,7 +93,7 @@ public static final java.lang.String WRITE_ID = "writeId"; - public static final java.lang.String SOFT_DELETE_DATABASE = "soft_delete_db"; + public static final java.lang.String SOFT_DELETE_OPERATION = "operation"; public static final java.lang.String EXPECTED_PARAMETER_KEY = "expected_parameter_key"; diff --git a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java index 5fdb6a49f802..ebef008459ab 100644 --- a/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java +++ b/standalone-metastore/metastore-common/src/main/java/org/apache/hadoop/hive/metastore/utils/MetaStoreUtils.java @@ -1344,4 +1344,9 @@ public static String getHttpPath(String httpPath) { public static boolean isDatabaseRemote(Database db) { return db != null && db.getType() == DatabaseType.REMOTE; } + + /** + * Soft delete operation types. + */ + public enum SoftDeleteOperation {DROP_DATABASE, DROP_TABLE} } diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java index 5096f7e4bd45..8b282d3c3e7c 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/AcidEventListener.java @@ -40,6 +40,7 @@ import org.apache.hadoop.hive.metastore.events.DropTableEvent; import org.apache.hadoop.hive.metastore.txn.TxnStore; import org.apache.hadoop.hive.metastore.txn.TxnUtils; +import org.apache.hadoop.hive.metastore.utils.MetaStoreUtils; import java.io.IOException; import java.util.Iterator; @@ -248,11 +249,11 @@ private long getTxnId(EnvironmentContext context) { } private void addSoftDeletePropertiesToRequest(EnvironmentContext context, CompactionRequest request) { - if ("true".equalsIgnoreCase(context.getProperties().get(hive_metastoreConstants.SOFT_DELETE_DATABASE))) { - request.putToProperties(hive_metastoreConstants.SOFT_DELETE_DATABASE, Boolean.TRUE.toString()); - if ("true".equalsIgnoreCase(context.getProperties().get(ReplConst.SOURCE_OF_REPLICATION))) { - request.putToProperties(ReplConst.SOURCE_OF_REPLICATION, Boolean.TRUE.toString()); - } + request.putToProperties(hive_metastoreConstants.SOFT_DELETE_OPERATION, + Optional.ofNullable(context.getProperties().get(hive_metastoreConstants.SOFT_DELETE_OPERATION)) + .orElse(MetaStoreUtils.SoftDeleteOperation.DROP_TABLE.name())); + if (Boolean.parseBoolean(context.getProperties().get(ReplConst.SOURCE_OF_REPLICATION))) { + request.putToProperties(ReplConst.SOURCE_OF_REPLICATION, Boolean.TRUE.toString()); } } } diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java index 70777da088e2..b4bf97934b63 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/handler/DropDatabaseHandler.java @@ -137,7 +137,8 @@ public DropDatabaseResult execute() throws TException, IOException { if (isSoftDelete) { context = new EnvironmentContext(); context.putToProperties(hive_metastoreConstants.TXN_ID, String.valueOf(request.getTxnId())); - context.putToProperties(hive_metastoreConstants.SOFT_DELETE_DATABASE, Boolean.TRUE.toString()); + context.putToProperties(hive_metastoreConstants.SOFT_DELETE_OPERATION, + MetaStoreUtils.SoftDeleteOperation.DROP_DATABASE.name()); if (ReplChangeManager.isSourceOfReplication(db)) { context.putToProperties(ReplConst.SOURCE_OF_REPLICATION, Boolean.TRUE.toString()); } diff --git a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java index 6cf9bcdb9e44..09858613e5ae 100644 --- a/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java +++ b/standalone-metastore/metastore-server/src/main/java/org/apache/hadoop/hive/metastore/txn/entities/CompactionInfo.java @@ -372,10 +372,10 @@ public boolean isAbortedTxnCleanup() { } public boolean isSoftDelete() { - return "true".equalsIgnoreCase(getProperty(hive_metastoreConstants.SOFT_DELETE_DATABASE)); + return getProperty(hive_metastoreConstants.SOFT_DELETE_OPERATION) != null; } public boolean isSourceOfReplication() { - return "true".equalsIgnoreCase(getProperty(ReplConst.SOURCE_OF_REPLICATION)); + return Boolean.parseBoolean(getProperty(ReplConst.SOURCE_OF_REPLICATION)); } }