Help Center/ AI DataLake/ devg/ Paimon Development Guide/ Paimon Development FAQs/ How Do I Handle Concurrent Data Commit Conflicts?
Updated on 2026-11-06 GMT+08:00

How Do I Handle Concurrent Data Commit Conflicts?

Paimon uses the optimistic concurrency control (OCC) to handle concurrent writes. When multiple jobs concurrently write data to the same Paimon table, commit conflicts may occur. Paimon detects these conflicts via its snapshot mechanism and retries the operation or reports an error.

Concurrent commit conflicts are classified into the following types:

  • Data conflict: Multiple concurrent jobs modify the data in the same partition or with the same primary key, causing the job that is committed later to detect a data change conflict.
  • Metadata conflict: Multiple concurrent jobs submit snapshot files simultaneously. The job that is committed later finds that the snapshot version has been updated by another job, resulting in a metadata conflict.

Conflict Handling Strategies

Paimon adopts different strategies based on the type of conflict and table scheme.

  • For concurrent append operations on an append-only table, Paimon automatically retries the commit. It merges the data from multiple appends and re-commits them.
  • For primary key tables, if concurrent writes target different primary keys, Paimon automatically retries and merges the data. If concurrent writes target the same primary key, the later committed jobs will fail and an error will be reported.
  • In scenarios where compaction and DML operations are executed concurrently, Paimon supports asynchronous compaction. Compaction does not block DML operations, but there may be temporary resource contention.

Suggestions

  • When performing concurrent DML operations on the same partition, it is recommended that you specify partition conditions in the WHERE clause to reduce the scope of potential conflicts.
  • In high-frequency concurrent write scenarios, you can use bucketing to distribute data evenly across different buckets. This reduces the probability of different jobs writing to the same data file.
  • Set the sink.commit.max-retries parameter properly to increase the number of commit retries and improve the success rate of concurrent writes.