apache / apache/hudi

[SUPPORT] Duplicates while partition is being updated

Open
#13,153 2 comments 0 reactions 0 assignees View on GitHub
issue:data-consistency
Dominant language
Java
Stars
6.2k
Forks
2.5k
Avg merge
2d 8h
Merged PRs (30d)
111

Description

**Describe the problem you faced**

If table is queried while a writing job is running - in which partition field is updated - there's a brief moment in which the table returns duplicates.

It seems to me that this happens in the moment where new version of the record was created in the new partition, and the old version was still not removed from the old partition..

When the job finishes, the table does not return duplicates.

Is there a way to solve it in this version of Hudi (v0.14.1) - or was it already solved in newer versions?

**To Reproduce**

Steps to reproduce the behavior:

1. Have a big table partitioned by a specific field
2. Run a job that will update the partitioned field
3. Query the table (in my case using Athena) - you may need to query several times until it gets to the moment in which it returns duplicates

Relevant options used:
'hoodie.datasource.write.table.type': 'MERGE_ON_READ',
'hoodie.datasource.write.operation': 'upsert',
'hoodie.index.type': 'RECORD_INDEX',
'hoodie.record.index.update.partition.path' = 'true',
'hoodie.compact.inline.max.delta.commits':'1'

**Expected behavior**

To not get duplicates at any time

**Environment Description**

* Hudi version : v0.14.1

* Spark version : 3.5.1

* Hive version : 3.1.3

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

Contributor guide

No contributing guide indexed for this repository

Research direction

No repository file or test is named. Start by reproducing the duplicate results with Hudi 0.14.1, Spark 3.5.1, MERGE_ON_READ, RECORD_INDEX, partition-path updates, and S3, then compare behavior in newer Hudi versions. Done means identifying the cause and documenting whether duplicates can be prevented during the partition update.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, java, spark
Domain
data-engineering, databases, distributed-systems
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.