Skip to content

[pixels-retina] TableUpdateData Loses Operation Order Across Delete, Insert, and Update #1398

Open

Description

@gengdy1545

Multiple operations on the same key within a single TableUpdateData can lead to ordering issues, affecting correctness.

Activity

  1. added theissue type on Sep 3, 2026
  2. added this to the Real-time CRUD milestone on Sep 3, 2026
  3. AntiO2 commented on Sep 3, 2026

    @AntiO2
    Collaborator

    I implemented a fix in Pixels-Sink to preserve the original operation order when sending CDC events to Retina.

    The root cause is that a single TableUpdateData stores INSERT, DELETE, and UPDATE operations in separate repeated fields. Retina processes these fields in a fixed order, so mixing different operation types in one TableUpdateData loses their original ordering. For example, an INSERT followed by a DELETE could be executed as DELETE followed by INSERT.

    The Sink now groups only adjacent rows with the same operation type into one TableUpdateData, while preserving the order of those groups:

    INSERT, INSERT, DELETE, DELETE, INSERT
    

    is encoded as:

    [INSERT, INSERT], [DELETE, DELETE], [INSERT]
    

    Implementation: pixelsdb/pixels-sink#20

  4. gengdy1545 commented on Sep 4, 2026

    @gengdy1545
    CollaboratorAuthor

    I implemented a fix in Pixels-Sink to preserve the original operation order when sending CDC events to Retina.

    The root cause is that a single TableUpdateData stores INSERT, DELETE, and UPDATE operations in separate repeated fields. Retina processes these fields in a fixed order, so mixing different operation types in one TableUpdateData loses their original ordering. For example, an INSERT followed by a DELETE could be executed as DELETE followed by INSERT.

    The Sink now groups only adjacent rows with the same operation type into one TableUpdateData, while preserving the order of those groups:

    INSERT, INSERT, DELETE, DELETE, INSERT
    

    is encoded as:

    [INSERT, INSERT], [DELETE, DELETE], [INSERT]
    

    Implementation: pixelsdb/pixels-sink#20

    Mixing different operation types in the same TableUpdateData does not necessarily cause incorrect results. The ordering only matters when multiple operations on the same key are included in the same TableUpdateData. So the fix is mainly needed to preserve the relative order of operations that target the same key, rather than requiring a strict global ordering across all CDC events.

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

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions