apache / apache/hudi

Log files in Hudi MOR table are not getting deleted

Open
#12,702 16 comments 0 reactions 0 assignees View on GitHub
area:table-service
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

**_Tips before filing an issue_**

- Have you gone through our [FAQs](https://hudi.apache.org/learn/faq/)?

- Join the mailing list to engage in conversations and get faster support at dev-subscribe@hudi.apache.org.

- If you have triaged this as a bug, then file an [issue](https://issues.apache.org/jira/projects/HUDI/issues) directly.

We use MOR Hudi table , We read kinesis stream and process in AWS EMR using spark streaming.
We use inline compaction and cleanup based on the commits,
Though compaction and cleanup is running we see some of hudi log files that are generated while ingestion are not getting cleared fully.
We process with batch interval of 5 mints for every 5 mints we do one hudi commit.

Below are our hudi configs

DataSourceWriteOptions.TABLE_TYPE.key() -> DataSourceWriteOptions.MOR_TABLE_TYPE_OPT_VAL,

DataSourceWriteOptions.RECORDKEY_FIELD.key() -> "guid",

DataSourceWriteOptions.PARTITIONPATH_FIELD.key() -> "collectionName",

DataSourceWriteOptions.PRECOMBINE_FIELD.key() -> "operationTime",

DataSourceWriteOptions.HIVE_PARTITION_FIELDS.key() -> "collectionName",

DataSourceWriteOptions.HIVE_PARTITION_EXTRACTOR_CLASS.key() -> classOf[MultiPartKeysValueExtractor].getName,

DataSourceWriteOptions.HIVE_SYNC_MODE.key() -> "hms",

DataSourceWriteOptions.HIVE_USE_JDBC.key() -> "false",*/

HoodieCompactionConfig.INLINE_COMPACT_TRIGGER_STRATEGY.key() -> CompactionTriggerStrategy.TIME_ELAPSED.name,

HoodieCompactionConfig.INLINE_COMPACT_TIME_DELTA_SECONDS.key() -> String.valueOf(60 * 6 * 60),

HoodieCompactionConfig.CLEANER_POLICY.key() -> HoodieCleaningPolicy.KEEP_LATEST_COMMITS.name(),

HoodieCompactionConfig.CLEANER_COMMITS_RETAINED.key() -> "228",

HoodieCompactionConfig.MIN_COMMITS_TO_KEEP.key() -> "229",

HoodieCompactionConfig.MAX_COMMITS_TO_KEEP.key() -> "252",

HoodieCompactionConfig.ASYNC_CLEAN.key() -> "false",

HoodieCompactionConfig.INLINE_COMPACT.key() -> "true",

HoodieMetricsConfig.TURN_METRICS_ON.key() -> "true",

HoodieMetricsConfig.METRICS_REPORTER_TYPE_VALUE.key() -> MetricsReporterType.DATADOG.name(),

HoodieMetricsDatadogConfig.API_SITE_VALUE.key() -> "US",

HoodieMetricsDatadogConfig.METRIC_PREFIX_VALUE.key() -> "XXXX.hudi",

HoodieMetricsDatadogConfig.API_KEY_SUPPLIER.key() -> "XXXXX.XXX.DatadogKeySupplier",

HoodieMetadataConfig.ENABLE.key() -> "false",

HoodieWriteConfig.ROLLBACK_USING_MARKERS_ENABLE.key() -> "false",

Snapshots attached :

![Image](https://github.com/user-attachments/assets/5e2f4639-aec9-4c4e-b363-fc0282d847fe)

![Image](https://github.com/user-attachments/assets/4d43e994-8845-41fc-80b6-3226487cae57)

If you want the .hoodi folder, Please let us know we will share it here.

* Hudi version : 0.9

* Spark version : 3.2.1

* EMR Version : 6.7

* Storage (HDFS/S3/GCS..) : S3

* Running on Docker? (yes/no) : no

Contributor guide

No contributing guide indexed for this repository

Research direction

Start by reviewing the MOR compaction and cleaner settings in the issue, especially the retained-commit values, then inspect the attached snapshots and reproduce the behavior with Hudi 0.9, Spark 3.2.1, EMR 6.7, and S3. Done means determining why generated log files remain after compaction and cleanup, with the relevant configuration or reproduction narrowed down.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, spark
Domain
cloud, data-engineering, stream-processing
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
22/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.