Skip to main content

Consistency and limits

Replay safety​

Every consumed source window is recorded in the engine's epoch table, keyed by the target. A retry of the same run sees the recorded window and skips the rows that were already written. The target commit and the cursor advance happen together.

A run is either fully applied or not applied at all. A failed run leaves the target at its previous committed state.

Rebuilds​

A rebuild recomputes the target from the full source and publishes it as one atomic commit. It does not truncate the user-visible target first, so readers never observe an empty table during a rebuild.

A rebuild happens when:

  • the query definition changes;
  • the target schema changes in a way the engine cannot reconcile;
  • the target has no usable state (for example, after it was dropped and recreated).

Concurrency​

  • Two runs against the same target are serialized by a per-target lease. The second waits or fails instead of interleaving writes.
  • A data commit written by another engine in a partition the run owns is detected before the run and again before its commit; the run fails instead of silently overwriting it. Compaction commits are allowed.
  • Ordinary writes to other partitions can proceed concurrently.

Partitions​

A run detects the source partitions whose commits changed and reads only their new data. The target is replaced only in the partitions it owns; other target partitions are left untouched.

Retention​

A run needs the source history between its cursor and the present. The Flink NewCleanJob is cursor aware: it keeps versions from the oldest view cursor to the present, in addition to dataExpiredTime, pinned versions and the latest version. A view may therefore refresh less often than dataExpiredTime. Avoid the legacy Spark CleanExpiredData / cleanOldCompaction paths on these tables; they do not honor cursors.

If history is missing, the run fails; the next run rebuilds from the current source state.

Limits​

LimitBehaviour
Autocommit onlyExplicit transactions and multi-statement batches are refused
INSERT ... SELECT onlyINSERT ... VALUES is always a normal insert
Keyed sources for incremental maintenanceAn insert-only append-only source can be recomputed through Tier-2 fallback; delete-bearing append-only sources are not maintained
Keyed targetThe target needs a primary key, rowKinds, and use_cdc = true
Distributed executionThe IVM entry can run with distributed workers; every worker must be built with the IVM feature and the same protocol generation. The coordinator resolves source windows and commits the files workers write.
Supported shapesA shape outside the list reports unsupported incremental view shape and writes nothing

Failure modes​

SymptomCause
source table ... has no primary keyThe source is append-only; use a keyed source or enable Tier-2 fallback for insert-only data
unsupported incremental view shapeThe query shape is outside the supported list
target table ... needs the internal rowKinds/__ivm_epoch columnsThe target is missing rowKinds (or the engine could not add the epoch column)
target table ... needs a primary keyThe target is not a keyed table
A concurrent-writer errorAnother engine wrote the target scope during the run; retry

Next​