Skip to content

applyDelta double-applies buffered deltas after compaction #4588

Closed

Description

@ruispereira

Affected version: 26.4.2 (confirmed still present in 26.5.1)
Component: com.arcadedb.graph.olap.GraphAnalyticalView
Severity: MEDIUM

Summary

When a compaction is in flight, every committed delta is both merged
into the current overlay AND stashed in pendingDeltas. After
compaction, the worker re-merges every buffered delta against the new
mapping — including those committed before the CSR scan crossed
their bucket, which are already in the new base CSR. The code makes no
attempt to distinguish the two populations.

Code reference

engine/com/arcadedb/graph/olap/GraphAnalyticalView.java:1256–1276

Impact

After compaction, neighbour lists transiently contain duplicate edges
in the overlay; deletion-driven accounting is also incorrect.
Duplicates persist until the next compaction.

Suggested fix

Stamp each buffered delta with the snapshot timestamp at which it was
applied, and only re-merge those whose timestamp is after the
compaction's CSR scan-start.

Activity

  1. self-assigned this
    on Jun 12, 2026
  2. added theissue type on Jun 12, 2026
  3. added this to the 26.7.1 milestone on Jun 12, 2026
  4. added a commit that references this issue on Jun 13, 2026
    a5be81a
  5. added a commit that references this issue on Jun 28, 2026
    3c4e4b4
  6. added a commit that references this issue on Aug 14, 2026
    3799bcb
  7. added 2 commits that reference this issue on Aug 26, 2026
  8. ruispereira commented on Sep 2, 2026

    @ruispereira
    ContributorAuthor

    Re-validated against main at c50338bd8: the add-side fresh-CSR dedup is in place.

    The deletion side still re-applies buffered deltas blindly, and GraphAnalyticalView.java:2558-2561 names "#4588's pair-level re-application dedup" as one of two documented open overlay gaps - the zero-clamp there exists because of it. The clamp protects the aggregate but not copyBaseExcludingDeleted, which can drop a live edge. Filed as a follow-up.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions