Skip to content

[Feature] Track incremental computation with row binlog, Table Stream, and MTMV #65418

Description

@morningman

Description

This issue tracks the end-to-end incremental computation capability in Apache Doris.

The implementation is being built in three layers:

OLAP table DML
    -> row binlog: durable row-level changes, before images, operation type, LSN/TSO
    -> Table Stream: change-query semantics, per-partition consumption offsets, snapshots and reset
    -> MTMV incremental maintenance: derive and transactionally apply only the affected result changes

This tracker replaces the stale umbrella issue #57921 and incorporates the row-binlog foundation originally tracked by #61956.

Goals

  • Provide a durable row-level change log for Doris internal tables.
  • Expose deterministic incremental consumption through Table Stream.
  • Provide snapshot reads aligned with stream consumption points for joins and recovery.
  • Integrate Table Stream with MTMV planning and refresh execution for row-level incremental maintenance.
  • Preserve correctness across replicas, compaction, schema changes, concurrent consumers, failures, retries, and restart/replay.
  • Add complete unit, regression, compatibility, and failure-recovery coverage.
  • Document supported table models, SQL syntax, semantics, limitations, and operational guidance.

Scope boundary

This tracker covers the internal row-binlog and Table Stream stack used by incremental computation, plus its MTMV integration. External CDC Streaming Jobs and general MTMV partition refresh or query-rewrite changes are out of scope unless they directly modify this stack.

FE-side (CCR) binlog is listed under "Adjacent work" below: it is a separate feature, but several correctness issues tracked here live in that code and are reported against the same stack.

The repository review has been refreshed through 2026-09-01. PR #61382 predates the original review window but is included because it is the Table Stream metadata and DDL foundation.

Status summary (2026-09-01)

Layer Merged Open / Draft Assessment
Row binlog 23 7 Main path complete; remaining work is scheduling locality, partial update, and throughput.
Table Stream 17 6 Local and cloud paths complete; metadata lifecycle and DDL surface still have gaps.
MTMV incremental maintenance 0 1 draft Implemented on a branch, but nothing has been merged. This is the critical path.

Progress

Row binlog foundation

Merged — core path:

Merged — fixes:

Open:

Table Stream foundation

Merged — core path:

Merged — fixes:

Open:

MTMV incremental maintenance

Corrected. The previous revision of this tracker stated that no MTMV implementation PR had been identified. That is no longer accurate:

Per #66719, the branch already covers projection, filter, aggregate (COUNT/SUM/AVG/MIN/MAX, bitmap aggregates, expression arguments, bare GROUP BY), INNER/CROSS/LEFT OUTER/FULL OUTER joins, UNION ALL, subquery aliases, REFRESH MATERIALIZED VIEW ... INCREMENTAL/PARTITIONS, dry-run, automatic full-refresh fallback, chained IVM MTMV, ivm_use_full_keys, and regression tests under mtmv_p0/ivm.

The blocker is not implementation, it is reviewability and landing. A single PR of this size cannot be reviewed effectively, and this layer currently has no assigned reviewer.

  • Split [feature](ivm) Support incremental view maintenance (IVM) for materialized tables (MTMV) #62606 into independently mergeable PRs (delta plan derivation, per-operator incremental semantics, MTMV lifecycle integration, atomic result-apply plus offset advancement, fallback and observability, tests).
  • Assign FE and storage reviewers for the split PRs.
  • Define supported MTMV query shapes and eligibility/fallback rules.
  • Derive delta plans from Table Streams, including snapshot sides for joins.
  • Define incremental semantics for projection, filter, join, union, aggregation, and supported expressions.
  • Integrate stream creation and lifecycle with MTMV creation, alteration, pause/resume, and drop.
  • Execute result changes and stream-offset advancement atomically.
  • Support full-refresh bootstrap/reset and fallback when incremental maintenance is not valid.
  • Define retry, idempotency, concurrent refresh, failover, and EditLog replay behavior.
  • Add observability for refresh mode, consumed offsets, lag, fallback reason, and failures.
  • Add FE and BE unit tests plus end-to-end regression tests for correctness and recovery.
  • Add user and operator documentation.

Adjacent work

Bug and correctness backlog

#65265 is the consolidated bug and test backlog. Current state:

The unowned correctness issues (#67091#67094, #67096#67108) were filed together on 2026-08-25 and are design-level defects rather than isolated bugs: BE restart recovery, replica repair and balancing, TSO boundary semantics, cloud publish/commit failure handling, leader/follower metadata divergence, and lock/scan target disagreement after RENAME or REPLACE TABLE. They need owners before they can be scheduled.

Correctness and compatibility checklist

  • DUP and supported UNIQUE KEY MOW table semantics are documented and tested.
  • Full update, partial update, delete, sequence column, hidden key, and schema-change paths are covered.
  • LSN/TSO ordering is deterministic across replicas and remains valid after clone and compaction.
  • Concurrent stream consumption either commits data and offsets together or fails without advancing offsets.
  • Snapshot, reset, and incremental reads agree at partition boundaries and after restart.
  • Binlog retention cannot silently invalidate an active stream or MTMV; stale state is observable and recoverable.
  • Unsupported plans fail clearly or use a documented full-refresh fallback.
  • Cloud-mode support or exclusion is explicit.
  • Upgrade, downgrade, rolling restart, backup/restore, and replication behavior is defined before general availability.
  • Enabling binlog does not regress import throughput to an unacceptable degree ([Bug](High) Enabling binlog reduces import throughput by about 65% #65947).

Overlapping or superseded PRs

Exit criteria

  • Row binlog and Table Stream semantics are stable and documented.
  • At least one supported MTMV query class refreshes incrementally end to end with atomic offset advancement.
  • Correctness, failure recovery, replay, compaction, and schema evolution tests pass in the supported deployment modes.
  • Unsupported cases have explicit diagnostics and a documented fallback.
  • Remaining limitations and follow-up work are tracked by linked issues or PRs.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

kind/featureCategorizes issue or PR as related to a new feature.tracking issue

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions