Skip to content

Proposal 0022: re-keying repairs both groups, whatever wrote the key - #43

Open
delchev wants to merge 1 commit into
mainfrom
spec/rekey-both-sides
Open

Proposal 0022: re-keying repairs both groups, whatever wrote the key#43
delchev wants to merge 1 commit into
mainfrom
spec/rekey-both-sides

Conversation

@delchev

@delchev delchev commented Aug 19, 2026

Copy link
Copy Markdown
Contributor

Adds proposals/0022-rekey-repairs-both-groups.md.

1.5 is already normative for aggregates: both tuples are repaired when a grouping key moves, and "the previous keys cannot be recovered after the write, so a conforming generator observes them before it". Two gaps sit next to that sentence:

  1. rollups are not held to it. Their section says nothing about re-parenting, and proposal 0021 leaves the vacated parent a MAY. A sum roll-up over a re-parented line is therefore specified to correct the parent that received it and to go on counting it in the parent it left. Nothing about the construct justifies the difference — a roll-up is an aggregate over one key.
  2. The repair is attached to one writer, not to the write. Observing the previous key "before the write" is naturally implemented on the path that carries a whole record (a form submit). A generator that also emits targeted writers — a process step's field setter, a lookup that resolves a relation, a task form persisting what it edited — has other ways to move exactly that column, and those writers deliberately raise no ordinary change event. The move a process makes, on records nobody re-opens by hand, is the one that silently skips the repair.

The proposal adds no syntax. It states the repair as a property of the write: when a grouping column changes, both the group the record left and the group it joined are recomputed, however the column was written — and the repair must reach the derived-total handlers without turning into a second change event for the record.

Found while fixing the same two gaps in a conforming generator: eclipse-dirigible/dirigible#6819

1.5 requires an aggregate to repair both tuples when a grouping key moves, but leaves two
gaps next to that sentence: rollups are not held to the same rule, and the observation of the
previous key is naturally attached to the ONE writer that carries a whole record - so a
targeted writer (a process step's field setter, a lookup, a task form) moves the same column
with neither side repaired.

Proposal 0022 states the repair as a property of the write: whenever a grouping column
changes - an aggregate key or a roll-up's `via` FK - both the group the record left and the
group it joined are recomputed, however the column was written, and without re-raising the
record's ordinary change event.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant