Skip to content

Delta change feed: split a window at a schema change instead of reading the table whole #2175

Open

Description

@bplatz

Follow-up from #2166.

Problem

Kernel refuses a change data feed range whose two ends have different schemas. So when a window spans a schema change, such as ALTER TABLE … ADD COLUMN, the pass reads the table whole instead. A whole read upserts what the table holds but cannot see what it no longer holds, so rows deleted inside that window stay in the target for good. An added column is probably the most common way a feed-enabled table loses a window.

#2166 logs this case as a schema change (fluree-db-delta/src/error.rs, change_feed_refusal), and docs/graph-sources/delta.md warns about it.

Proposal

Split the window at the change rather than reading whole. Kernel serves a range whose ends share a schema: in the review's repro, with a metaData commit at version 6, changes_since(5) opens fine. A change feed scan can already end early through MaterializeScan::stopped_at, so a pass can:

  1. find the first version in (from, to] whose commit changes the schema (its metaData action);
  2. read the feed through the version before it, and report that as stopped_at;
  3. let the next pass start there, with a range whose ends share the new schema.

Nothing is lost, and the whole-read fallback is left for the cases that need it (feed off, log cleaned).

Testing

a_schema_change_inside_a_range_is_named_as_such in fluree-db-delta/tests/reader.rs stages a schema change on a copy of the change_feed fixture. The same staging works for a reader test that reads across the change in two ranges, and for an end-to-end test in fluree-db-api/tests/it_delta_local_fs.rs in which a delete before the change reaches the target.

Activity

  1. added
    P2
    area:iceberg
    on Oct 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2area:iceberg

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions