Commit 22277d7
[BugFix] Don't advance batch-apply rssid offset for zero-segment op_writes
Row-mode partial update on lake PK produced duplicate PK rows: in the
batch-apply path, MetaFileBuilder::add_rowset advanced
_pending_rowset_data.assigned_segment_idx via get_rowset_id_step() on every
op_write, including a leading ZERO-segment op_write (get_rowset_id_step
returns 1 for an empty rowset). Because the pending rowset still had
segment_metas_size()==0, the next segment-bearing op_write re-entered the
first-call branch and stamped its first segment with a non-positional
segment_idx (assigned_segment_idx + 0 = 1). At read the segment's effective
rssid (rowset.id() + segment_idx) landed one slot above where the base-row
delete vector was keyed at apply, so the superseded base rows were never
hidden -> duplicate PKs. Only advance assigned_segment_idx for op_writes
that actually deposit segments.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent 2330827 commit 22277d7
1 file changed
Lines changed: 11 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1498 | 1498 | | |
1499 | 1499 | | |
1500 | 1500 | | |
1501 | | - | |
| 1501 | + | |
| 1502 | + | |
| 1503 | + | |
| 1504 | + | |
| 1505 | + | |
| 1506 | + | |
| 1507 | + | |
| 1508 | + | |
| 1509 | + | |
| 1510 | + | |
| 1511 | + | |
1502 | 1512 | | |
1503 | 1513 | | |
1504 | 1514 | | |
| |||
0 commit comments