Repository navigation
Conversation
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
XuPeng-SH
left a comment
There was a problem hiding this comment.
[P1] Close the reader-side compatibility boundary for Backup artifacts already emitted by affected 4.2 builds
The new producer path is correct: newly rewritten tombstones get the canonical [0, 1, SEQNUM_COMMITTS] layout. However, this backport intentionally leaves existing affected Backup artifacts unchanged, so the concrete #26991 failure remains reachable after upgrading/restoring.
For an affected non-CN tombstone with meta_columns=3, max_seq=2, and a trailing physical TS column, objectio.ReadOneBlock still decides that no hidden commitTS exists and synthesizes a const-null TS vector. ReadDeletes returns that as success without validating availability or physical/logical row counts. IsRowDeletedByLocation then indexes tss by the non-empty rowid length, and FillBlockDeleteMask reaches the same failure through EvalDeleteMaskFromDNCreatedTombstones.
I reproduced both panics deterministically on this exact head using the old Backup generic writer and the exact physical [rowid, timestamp-valued PK, commitTS] / dense [0,1,2] metadata shape. The timestamp-PK control confirms that compatibility must be narrow and metadata-aware rather than a global “last TS column” fallback. The PR tests only read newly canonicalized output, so they cannot detect this remaining path.
This is a merge blocker because an affected Backup can be the only recovery copy; requiring it to be recreated is impossible precisely when restore is needed, and #26991 explicitly requires malformed/legacy metadata to produce bounded behavior instead of a recovered runtime panic.
Please add one shared reader boundary before either consumer indexes commitTS:
- recover the physical trailing TS for the narrowly identifiable malformed Backup signature when unambiguous;
- otherwise return an explicit bounded compatibility/corruption error;
- cover both IsRowDeletedByLocation and EvalDeleteMaskFromDNCreatedTombstones/FillBlockDeleteMask, including the timestamp-valued PK control.
Validation performed on this head:
- new focused Backup tests: pass;
- full pkg/vm/engine/tae/logtail: pass;
- pkg/objectio/ioutil: pass;
- logtail build and vet: pass;
- reviewer-only affected-artifact counterexample: both reader paths still panic (temporary test removed).
Q1-Q3 audit: the new producer cleanup/ownership paths are sound; no new wait or unbounded-growth edge found. The blocker is the still-open persisted-format read/restore terminal path.
|
Thanks. I reproduced the affected-artifact path and agree that the reader-side compatibility boundary is required. This PR is updated in commit The v4.1.4 same-version result is expected: the v4.1 reader still infers the trailing physical TS column by position. The durable artifact nevertheless has the generic-writer metadata ( The 4.2-specific implementation now:
The backport intentionally preserves 4.2's reader protocol: without PK it reads The review also exposed two adjacent closure issues that are fixed here:
Validation on the final frozen diff:
The PR description has also been updated with the same-version explanation, exact compatibility signature, and 4.2-specific layout boundary. |
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
The prior reviewer’s ReadDeletes point-lookup/block-mask panic is addressed, but legacy compatibility is incomplete in other readers. Focused tests pass; the findings below are distinct from the existing review finding.
P1 - Legacy generic-writer tombstones now fail through the snapshot datasource (pkg/vm/engine/tae/logtail/backup.go:409)
GetTombstones bypasses the new ReadDeletes compatibility reload and calls visibleAppendableRows directly. For an affected legacy object [rowid, pk, commitTS] with meta_columns=3 and max_seq=2, resolveBackupSpecialColumnLayout starts at position 3 and reports no commitTS, so validation returns appendable tombstone has no commit timestamp and the snapshot/PITR read fails. The base code read the trailing physical TS vector and succeeded. The compatibility mapping must also cover this path (and have a regression test).
P2 - Varlen-PK conflict checks still treat legacy tombstones as changed (pkg/vm/engine/disttae/txn_table.go:2988)
The cached-search branch for varchar/varlen PKs calls LoadColumnDataBySearchAndCheckTS, which reads SEQNUM_COMMITTS directly and never uses the legacy reload in ReadDeletes. On the same legacy layout, ObjectIO supplies a const-null commit vector; AnyCachedTSInRange returns usable=false, and lines 3005-3009 conservatively report the tombstone as changed. Thus a matching tombstone whose physical trailing commitTS is outside (from,to] causes a false transaction-conflict result. This is safe against missed conflicts but violates the PR’s stated PK-change compatibility and can cause avoidable aborts.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
The c96 snapshot/PITR and varlen-PK blockers are fixed; 51620 fixes the prior TAE persisted Scan/range under-delete blocker. A distinct normal table-scan blocker remains in FillBlockTombstones. The added tests do not cover this path; focused runtime tests were unavailable because native CGo dependencies are missing.
P1 - Apply per-row commitTS in FillBlockTombstones (pkg/vm/engine/tae/tables/pnode.go:390)
The normal table-read path calls FillBlockTombstones, but it requests only colIdxs := []int{0}. Therefore LoadPersistedColumnData receives isTombstone=true with committsIdx == -1, so the new validation and legacy-column reload never run. For non-appendable tombstones, this function only checks object CreatedAt and applies commitTS filtering only when IsAppendable(). Rewritten backup tombstones are explicitly non-appendable, while the rewrite preserves the source CreateTS; the test data creates the object at TS 5 and retains a row with commitTS 10 at backup TS 15. A snapshot at TS 7 can consequently see the tombstone object while the row-level delete is not yet committed, but this path adds its rowid to the delete mask and over-deletes the data row. This is distinct from the fixed Scan/range issue: those paths omitted or misread tombstones, whereas this path applies them too early. Load and validate the hidden commitTS here, preserve the two-column CN-created CreatedAt behavior, filter commitTS <= txn start, and add a HybridScan regression.
XuPeng-SH
left a comment
There was a problem hiding this comment.
[P1] Preserve row-level commit visibility in normal TAE scans
The latest patch fixes the explicit Scan/range readers, but FillBlockTombstones in pkg/vm/engine/tae/tables/pnode.go still requests only column 0. LoadPersistedColumnData therefore never sees SEQNUM_COMMITTS, so neither the canonical nor legacy commitTS mapping participates in visibility. A backup-rewritten tombstone is nonappendable while retaining the original appendable object CreatedAt; checking only that object timestamp cannot prove every row delete is visible.
I reproduced this on exact head 51620de: using the existing TestPersistedNodeReadsLegacyBackupTombstone fixture with object CreatedAt=10, row commitTS values 10 and 20, and transaction start=15, FillBlockTombstones inserted both row offsets into the delete mask. The commitTS=20 row must remain visible. This is the path used by normal HybridScanByBlock, so snapshot reads can return a false deletion.
Please make this path load and validate per-row commitTS for rewritten/legacy TN tombstones that carry it, filter rows by commitTS <= transaction start, preserve the established CN-created two-column tombstone behavior, and add a FillBlockTombstones or HybridScan regression for the mixed-commitTS snapshot.
|
已处理 reviews 4918324241 / 4918483169,确认这是有效的正常 TAE scan 可见性缺口,修复提交为 本轮修复:
新增
本地验证通过:
@XuPeng-SH @gouhongshen 已重新 request review,麻烦基于新 head |
XuPeng-SH
left a comment
There was a problem hiding this comment.
Re-reviewed exact head 29eff4237c6d042095522a798c04a262a326646a after the latest normal-scan visibility fix. No merge blocker found.
The previously open closure edges are now covered: canonical Backup production, the exact legacy dense [rowid, pk, commitTS] artifact, point lookup/block masks, Backup datasource, varlen-PK conflict checks, TAE copy/zero-copy/range readers, and normal FillBlockTombstones visibility. Non-appendable TN tombstones now apply row deletes only when commitTS <= txn.StartTS; the established two-column CN/legacy CreatedAt semantics remain intact. Constant vectors use logical broadcast access, malformed commit columns fail explicitly, and the compatibility reload/cache-lease and batch/vector ownership paths terminate exactly once.
Validation on this head:
- full tests passed for
pkg/objectio/ioutil,pkg/vm/engine/tae/logtail,pkg/vm/engine/tae/tables,pkg/vm/engine/disttae, andpkg/vm/engine/disttae/logtailreplay; - focused compatibility/visibility/resource regressions passed under
-race; - affected-package
go list, build, vet, andgit diff --checkpassed; - Q1-Q3 unhappy-path audit found no new leak, double-cleanup, wait-for, or unbounded-growth edge.
Per reviewer direction, I did not wait for the four still-running remote CI jobs. At submission time they had no failures, and the PR head was unchanged.
gouhongshen
left a comment
There was a problem hiding this comment.
Codex automated review
All prior blockers are resolved: legacy reader compatibility, snapshot/PITR and varlen-PK paths, persisted TAE scans/ranges, and per-row tombstone commitTS filtering. The latest change correctly covers canonical, legacy dense, and CN tombstone layouts. No remaining correctness, resource, concurrency, performance, or unhappy-path findings. Focused tests were blocked by missing native CGo headers.
What type of PR is this?
Which issue(s) this PR fixes:
issue #26991
What this PR does / why we need it:
This is the
4.2-devbackport of #26998, adapted to the 4.2 tombstone reader and on-disk layout.Backup rewrites appendable TN tombstones after filtering rows by the backup timestamp. The old rewrite path used a generic block writer, which assigned dense seqnums to the physical
[rowid, pk, commitTS]batch. As a result, commitTS was persisted as ordinary seqnum2instead of hiddenSEQNUM_COMMITTS.The v4.1 reader inferred that trailing column by position, so a v4.1.4 backup restored by v4.1.4 still works. The stricter 4.2 reader treats commitTS as absent, synthesizes a const-null vector with no fixed backing values, and could panic, reject recovery, silently omit tombstones, or conservatively report false PK conflicts depending on the consumer.
This PR closes both the producer and every identified reader boundary.
For newly generated backups, the trim path now produces one canonical non-appendable TN tombstone layout:
The producer implementation:
BlockWriter, whose fixed-width metadata scan otherwise indexes beyond the one-value backing;objDatareferences.For existing malformed Backup artifacts, the reader implementation:
meta_columns=3,max_seq=2,[Rowid, PK, TS], and no strict hidden commitTS);2as commitTS while keeping a timestamp-valued user PK distinct;persistedNode.ScanandCollectObjectTombstoneInRangethrough the compatibility mapping, while preserving the established two-column CN tombstoneCreatedAtsemantics;4.2-devpredates the sharedobjectio.SpecialColumnLayoutand still uses a reader layout without abort ([rowid, commitTS], or[rowid, pk, commitTS]when PK is requested). This backport preserves that 4.2 protocol and keeps an equivalent special-column resolver local to Backup instead of pulling later appendable-object/abort reader changes into the maintenance branch.The fix is fileservice-backend independent, so DISK, DISK-V2, and S3 Backup rewrites use the same corrected metadata and reader paths.
Validation:
CreatedAt;canonicalize -> WriteBatch -> Sync -> ReadDeletes;IsRowDeletedByLocationverification;pkg/objectio/ioutil,pkg/vm/engine/tae/logtail,pkg/vm/engine/tae/tables,pkg/vm/engine/disttae, andpkg/vm/engine/disttae/logtailreplay;go list, build, vet, and scopedgolangci-lint(0 issues).