All Products
Search
Document Center

MaxCompute:ACID transaction management

Last Updated:Mar 25, 2026

When multiple jobs write to the same Delta table concurrently, you need to understand which operation combinations conflict, how MaxCompute resolves those conflicts, and how to design your pipelines to avoid them. MaxCompute uses MetaService to manage all data modification operations on Delta tables as transactions. Multiversion concurrency control (MVCC) isolates concurrent read and write operations on snapshots, while optimistic concurrency control (OCC) handles transaction concurrency.

Conflict detection rules

The following table shows how MaxCompute resolves conflicts between concurrent jobs on the same non-partitioned table or partition. The job that finishes first is the earlier job; the job that finishes later is the later job.

Earlier jobLater jobOutcome
INSERT OVERWRITE / TRUNCATEINSERT OVERWRITE / TRUNCATEBoth succeed. The later job's result overwrites the earlier job's result.
INSERT OVERWRITE / TRUNCATEINSERT INTOEarlier job succeeds. Later job fails.
INSERT OVERWRITE / TRUNCATEUPDATE / DELETEEarlier job succeeds. Later job fails.
INSERT OVERWRITE / TRUNCATEMINOR COMPACTEarlier job succeeds. Later job fails.
INSERT OVERWRITE / TRUNCATEMAJOR COMPACTEarlier job succeeds. Later job fails.
INSERT INTOINSERT OVERWRITE / TRUNCATEBoth succeed. The later job's result overwrites the earlier job's result.
INSERT INTOINSERT INTOEarlier job succeeds. Later job fails.
INSERT INTOUPDATE / DELETEEarlier job succeeds. Later job fails.
INSERT INTOMINOR COMPACTBoth succeed. The compaction from the later job completes.
INSERT INTOMAJOR COMPACTEarlier job succeeds. Later job fails.
UPDATE / DELETEINSERT OVERWRITE / TRUNCATEBoth succeed. The later job's result overwrites the earlier job's result.
UPDATE / DELETEINSERT INTOEarlier job succeeds. Later job fails.
UPDATE / DELETEUPDATE / DELETEEarlier job succeeds. Later job fails.
UPDATE / DELETEMINOR COMPACTBoth succeed. The compaction from the later job completes.
UPDATE / DELETEMAJOR COMPACTEarlier job succeeds. Later job fails.
MINOR COMPACTINSERT OVERWRITE / TRUNCATEBoth succeed. The later job's result overwrites the earlier job's result.
MINOR COMPACTINSERT INTOBoth succeed. New data from the later job is written.
MINOR COMPACTUPDATE / DELETEBoth succeed. New data from the later job is written.
MINOR COMPACTMINOR COMPACTEarlier job succeeds. Later job fails.
MINOR COMPACTMAJOR COMPACTBoth succeed. The compaction from the later job completes.
MAJOR COMPACTINSERT OVERWRITE / TRUNCATEBoth succeed. The later job's result overwrites the earlier job's result.
MAJOR COMPACTINSERT INTOBoth succeed. New data from the later job is written.
MAJOR COMPACTUPDATE / DELETEBoth succeed. New data from the later job is written.
MAJOR COMPACTMINOR COMPACTEarlier job succeeds. Later job fails.
MAJOR COMPACTMAJOR COMPACTEarlier job succeeds. Later job fails.
Note

These rules apply at the transaction level, not at the row or file level.

Concurrency conflict optimization

MaxCompute optimizes conflict handling for common operation combinations, reducing unnecessary failures while preserving data correctness.

Note

Concurrency conflict optimization applies to single-table transaction management only.

Smart conflict resolution

Not all overlapping transactions conflict. For example, when a clustering operation and an INSERT INTO operation overlap in start and commit time, both succeed. Clustering reorganizes the physical layout of data without changing data status, so it cannot cause status inconsistency with a concurrent write. MaxCompute detects this and allows both to proceed. The transaction conflict handling logic will continue to be optimized to adapt to more scenarios.

Metadata-level retry

When conflict detection fails, MaxCompute retries at the metadata level. No data needs to be re-read or re-written. This reduces resource consumption compared to rerunning the full job.

Atomic metadata updates

Metadata is updated atomically to guarantee data consistency.

Data file version management

Each transaction generates a batch of new data files associated with two version types:

Version typeData typeGenerated whenUsed for
Time versionTIMESTAMPUser-triggered operations that make logical data changes only. Clustering and compaction do not generate a new time version.Incremental queries by time. Files from clustering and compaction are excluded.
ID versionAuto-increment integerEvery data operation in a transaction, including clustering and compaction.Internal transaction management (primary). Also available for incremental queries.