Skip to content

[SUPPORT] Flink COW append mode unnecessary replacecommit in old partitions  #9130

@ertanden

Description

@ertanden

Describe the problem you faced

We have an append mode COW table, where we sink messages incoming from a Kafka topic. Table is partitioned by day.

Clustering is enabled and we also have cleaner configured with KEEP_LATEST_FILE_VERSIONS for retaining only 1 file version.

The problem is whenever clustering is triggered, although the previous day partitions already has just a single file and no new commits in those old partitions, there's still a replacecommit periodically applied. So it seems like it copies the single file unnecessarily to a new one and then the cleaner gets rid of the old file. I tried setting the clustering filter mode to RECENT_DAYS, but it still does the same thing for the partition of yesterday.

You can see down below the timeline for the partition from yesterday 2023-07-04.

Am I missing something? Is there some configuration I need to make to prevent this? Or is this a bug?

Thanks!

Expected behavior

I don't expect a replacecommit when there's only a single file anyways in the partition without any new commits.

Environment Description

  • Hudi version : 0.13.1

  • Flink version : 1.16.2

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

  • Running on Docker? (yes/no) : yes, kubernetes

Additional context

╔═══════════════╤═══════════════════╤════════════╤═════════════════════════════════════════╤═════════════════╤════════════╤═════════════╤═════════════╤═══════════════════╤══════════════╤══════════════════╤═════════════════════════╤═══════════════════════╤═══════════════════╤═════════════════════════════════╤═════════════════════╗
║ Action        │ Instant           │ Partition  │ FileId                                  │ Previous Commit │ Num Writes │ Num Inserts │ Num Deletes │ Num Update Writes │ Total Errors │ Total Log Blocks │ Total Corrupt LogBlocks │ Total Rollback Blocks │ Total Log Records │ Total Updated Records Compacted │ Total Bytes Written ║
╠═══════════════╪═══════════════════╪════════════╪═════════════════════════════════════════╪═════════════════╪════════════╪═════════════╪═════════════╪═══════════════════╪══════════════╪══════════════════╪═════════════════════════╪═══════════════════════╪═══════════════════╪═════════════════════════════════╪═════════════════════╣
║ replacecommit │ 20230705152558040 │ 2023-07-04 │ 8a61fa78-edb6-4921-b339-a3e1d1a3124d-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705152158072 │ 2023-07-04 │ 027e0d7a-4be8-4661-9399-b80e3eedd24c-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705151758257 │ 2023-07-04 │ 62cc0a2b-4b3a-473d-a18c-091ee8e4846b-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705151357744 │ 2023-07-04 │ bc0974ba-3f2a-4885-accd-05133f44366b-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705150958014 │ 2023-07-04 │ 9a8e88e1-8109-4554-840d-df188eb097cd-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705150558125 │ 2023-07-04 │ 9ec0aaa8-4abd-4f31-826f-1e7dcd7fe985-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705150158159 │ 2023-07-04 │ e1acfa81-cd29-41b8-bc76-8ce83330ce10-0  │ null            │ 6705       │ 6705        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 674,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705150022378 │ 2023-07-04 │ 3a6bdbd2-15f4-492a-a46d-66e88a4c9a2f-28 │ null            │ 117        │ 117         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 432,9 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145923082 │ 2023-07-04 │ 62eb405a-7cbf-46cb-b7b8-2577bb65184f-37 │ null            │ 100        │ 100         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 431,7 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145923082 │ 2023-07-04 │ ec3a9beb-71c7-4750-b81c-7367f37c85fb-36 │ null            │ 11         │ 11          │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 428,3 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145830077 │ 2023-07-04 │ 9a000aad-aacb-471f-bc38-30123a654607-8  │ null            │ 2166       │ 2166        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 514,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145830077 │ 2023-07-04 │ 3673fdd1-22b9-4007-ba3c-57d12140a4aa-3  │ null            │ 1573       │ 1573        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 488,5 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145830077 │ 2023-07-04 │ cb7f38c3-a396-4f7e-93a6-98f17d969793-2  │ null            │ 407        │ 407         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 442,0 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145830077 │ 2023-07-04 │ 7a1f01a3-9b97-410b-9046-e9b48cd4e8d0-24 │ null            │ 1588       │ 1588        │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 489,2 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ replacecommit │ 20230705145827741 │ 2023-07-04 │ 8a4217a1-13cb-4f7d-a1bd-259cdaa6d246-0  │ null            │ 743        │ 743         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 458,7 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145730210 │ 2023-07-04 │ 33744ee3-9c78-47d5-ae64-4655e071dc80-38 │ null            │ 51         │ 51          │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 429,6 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145730210 │ 2023-07-04 │ 8de58cf1-9cc6-4cfb-a2ae-2baa846a62f9-33 │ null            │ 319        │ 319         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 439,5 KB            ║
╟───────────────┼───────────────────┼────────────┼─────────────────────────────────────────┼─────────────────┼────────────┼─────────────┼─────────────┼───────────────────┼──────────────┼──────────────────┼─────────────────────────┼───────────────────────┼───────────────────┼─────────────────────────────────┼─────────────────────╢
║ commit        │ 20230705145730210 │ 2023-07-04 │ aa7321dc-a64a-412e-8131-3977e53b720e-44 │ null            │ 373        │ 373         │ 0           │ 0                 │ 0            │ 0                │ 0                       │ 0                     │ 0                 │ 0                               │ 442,5 KB            ║
╚═══════════════╧═══════════════════╧════════════╧═════════════════════════════════════════╧═════════════════╧════════════╧═════════════╧═════════════╧═══════════════════╧══════════════╧══════════════════╧═════════════════════════╧═══════════════════════╧═══════════════════╧═════════════════════════════════╧═════════════════════╝

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    🏁 Triaged

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions