diff --git a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java index 32f05cbad..f3225a3a1 100644 --- a/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java +++ b/hudi-client/hudi-client-common/src/main/java/org/apache/hudi/metadata/HoodieBackedTableMetadataWriter.java @@ -535,7 +535,7 @@ public abstract class HoodieBackedTableMetadataWriter implements HoodieTableMeta * All FileGroups for a given metadata partition has a fixed prefix as per the {@link MetadataPartitionType#getFileIdPrefix()}. * Each file group is suffixed with 4 digits with increments of 1 starting with 0000. * - * Lets say we configure 10 file groups for record level index partittion, and prefix as "record-index-bucket-" + * Lets say we configure 10 file groups for record level index partition, and prefix as "record-index-bucket-" * File groups will be named as : * record-index-bucket-0000, .... -> ..., record-index-bucket-0009 */ diff --git a/hudi-common/src/main/java/org/apache/hudi/metadata/BaseTableMetadata.java b/hudi-common/src/main/java/org/apache/hudi/metadata/BaseTableMetadata.java index ccd421e67..5373e9860 100644 --- a/hudi-common/src/main/java/org/apache/hudi/metadata/BaseTableMetadata.java +++ b/hudi-common/src/main/java/org/apache/hudi/metadata/BaseTableMetadata.java @@ -231,18 +231,18 @@ public abstract class BaseTableMetadata implements HoodieTableMetadata { } /** - * May be handle spurious deletes. Depending on config, throw an exception or log a warn msg. + * Maybe handle spurious deletes. Depending on config, throw an exception or log a warn msg. * @param hoodieRecord instance of {@link HoodieRecord} of interest. * @param partitionName partition name of interest. */ private void mayBeHandleSpuriousDeletes(Option> hoodieRecord, String partitionName) { if (!hoodieRecord.get().getData().getDeletions().isEmpty()) { - if (!metadataConfig.ignoreSpuriousDeletes()) { + if (metadataConfig.ignoreSpuriousDeletes()) { + LOG.warn("Metadata record for " + partitionName + " encountered some files to be deleted which was not added before. " + + "Ignoring the spurious deletes as the `" + HoodieMetadataConfig.IGNORE_SPURIOUS_DELETES.key() + "` config is set to true"); + } else { throw new HoodieMetadataException("Metadata record for " + partitionName + " is inconsistent: " + hoodieRecord.get().getData()); - } else { - LOG.warn("Metadata record for " + partitionName + " encountered some files to be deleted which was not added before. " - + "Ignoring the spurious deletes as the `" + HoodieMetadataConfig.IGNORE_SPURIOUS_DELETES.key() + "` config is set to false"); } } }