-
Notifications
You must be signed in to change notification settings - Fork 2.5k
[HUDI-4777] Fix flink gen bucket index of mor table not consistent wi… #6595
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[HUDI-4777] Fix flink gen bucket index of mor table not consistent wi… #6595
Conversation
…th spark lead to duplicate bucket issue
|
As discussed in the closed pr, I think consider the log only fileslice when loading bucketId-fileId mapping is better, because
|
|
There are two following considerations that I think follow spark is more graceful:
|
|
There is a property named |
Thanks for your suggestion, I will give another pr fix in spark side too, in spark side, load the index both consider log and base, considering canIndexLogFile. |
Seems we should fix the code in spark side right ? |
|
I will fix give pr fix in spark side too, but in flink side, I think deduplicate should also open as default option for mor table , when duplicate write to log file, very hard for compact to read, also lead mor table not stable due to the duplicate record twice read into memory. |
Do you mean that there are two client writing to the same partition at the same time? |
The initial idea is to keep the details of the log records, such as in the cdc change log feed. |
Not exactly, if we deduplicate the record in memory, and then write to log is elegant for MOR because result is same. As @danny0405 say, in cdc situation, we need to retain origin records, not compact firstly in memory, which is acceptable. |
|
Guess we can close this PR now, feel free to reopen it if you still have questions. |
Change Logs
Make hudi-flink of mor table also will gen CreateHandle with base bucket not exist.
Open deduplicate function for mor table.
Impact
The duplicate issue is from hudi-flink mor table, which first append log, but not compact right now, so the bucket num is not in base file;
When spark use loadPartitionBucketIdFileIdMapping of org.apache.hudi.index.bucket.HoodieSimpleBucketIndex, it will not find the bucket num which written by hudi-flink, so it will generate a new one which not consistent with hudi-flink.
After this change, when hudi-flink write mor table use bucket index, it will firstly consider to write base parquet file after deduplicate, if base file exists, it will change to write log file, follow spark way seems more stable for mor table.
Risk level: none | low | medium | high
None.
Contributor's checklist