Skip to content

Write-skew reader query checks vertices across logical pairs #253

Description

@liulx20

Problem

In acid.tex, the Write Skew test defines pair k as:

  • p1.id = 2*k+1
  • p2.id = 2*k+2

Therefore the logical pairs are (1,2), (3,4), ..., (19,20).

However, the WS T_R query in Listing fig:ws2 matches every pair of consecutive IDs:

MATCH (p1:Person),
      (p2:Person {id: p1.id+1})
WHERE p1.value + p2.value <= 0

This also checks cross-pair neighbors such as (2,3), even though those vertices belong to different logical pairs. Such a pair is not covered by the invariant and can produce a false write-skew violation.

The same query was propagated to several implementations in ldbc/ldbc_acid; see ldbc/ldbc_acid#15.

Suggested fix

Restrict p1 to the first (odd-ID) vertex of each logical pair:

MATCH (p1:Person),
      (p2:Person {id: p1.id+1})
WHERE p1.id % 2 = 1
  AND p1.value + p2.value <= 0

This makes the anomaly-check query consistent with the pair definition in the preceding test description.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions