Repository navigation
Description
Is there an existing issue for the same bug?
- I have checked the existing issues.
Branch Name
main
Commit ID
Other Environment Information
- Hardware parameters:
- OS type:
- Others: code inspection of origin/main. No open issue covers
SnapshotMeta.SaveMeta/SaveTableInfodropping off-heap append errors. [Bug]: v12 checkpoint reader drops append errors and can omit objects or panic #29263 is the v12 checkpoint reader (compatibilityForV12). [Bug]: checkpoint GC clears a keep-set failure and can delete an object a live table still references #29258 isGCExecutor.Runwiping a keep-set error. [Bug]: TAE metadata writers must propagate append/write errors before publishing incomplete state #29261 is an ignoredsinker.Writein the checkpoint writer.
Actual Behavior
SnapshotMeta.SaveMeta and SaveTableInfo (pkg/vm/engine/tae/logtail/snapshot.go) build off-heap batches with containers.MakeVector(..., common.DebugAllocator) and ignore every vector.AppendBytes / vector.AppendFixed error. They then WriteWithoutSeqnum + WriteEnd and return size, nil.
containers.NewVector is vector.NewOffHeapVecWithType (pkg/vm/engine/tae/containers/vector.go 101–104). DebugAllocator is mpool.NewMPool("tae_debug", 0, mpool.NoFixed), so Cap() is PiB and the practical failure is GlobalCap (pkg/common/mpool/mpool.go alloc, off-heap branch). appendOneFixed returns before publishSingleAppend when extendWithBitmaps fails. AppendBytes rolls the append back when the varlena area cannot grow. The column length does not increase.
objectWriterV1.addBlock (pkg/objectio/writer.go 790–867) sets the block row count from column 0 and only Debug logs a later column whose Length() differs. It still marshals each column and WriteEnd succeeds.
checkpointCleaner.scanCheckpointsLocked (pkg/vm/engine/tae/db/gc/v3/checkpoint.go 2628–2695) treats that nil as success and records the snapshot file and the account file. Replay loads the latest of each (checkpoint.go 451–518) via ReadMeta / ReadTableInfo into a fresh SnapshotMeta.
The in-memory maps are unchanged in the process that just flushed them. The short file is what the next TN restart rebuilds from.
-
Silent omit,
SaveMeta. Column 0 isObjectAttr_ObjectStats. If thatAppendBytesfails,Batch.Length()/ the block row count stay at the previous object.Rebuild(snapshot.go1695–1763) walks only that length, so the failed mo_snapshots / PITR / ISCP object is not restored.GetSnapshot/GetPITR/GetISCPthen miss the rows stored in that object.MergeTableInfo(snapshot.go2156–2176) drops a deleted table when the rebuilt snapshot list and PITR do not refer to it, andObjectIsSnapshotRefers(checkpoint.go1692–1713) will not keep the user objects those rows still name. -
Panic on replay instead of the allocation error. If column 0 grows and a later fixed column does not,
RebuildindexesMustFixedColWithTypeCheck(insCreateTSs[i]/insTides[i]) past the short slice.RebuildTableInfodoes the same withGetRawBytesAton the PK column (snapshot.go1600–1644). GC replay has norecoveraroundReadMeta/ReadTableInfo.SaveMeta/SaveTableInfohave already returned nil and the file is the one replay selects.
SaveTableInfo has the same shape. Column 0 is the account id. A failed account append omits the table row. A failed PK append after the account id grew makes RebuildTableInfo panic. A missing table id is absent from GetAllTableIDs (exec_v1.go buildTableExistenceMap) after replay.
saveSnapshot also logs a non-nil SaveTableInfo error and still returns nil (checkpoint.go 2659–2676), so a real write failure is not a failed scan. The data-loss path above does not need that: WriteEnd succeeds on the short batch.
Expected Behavior
An off-heap append failure in SaveMeta or SaveTableInfo should return that error. scanCheckpointsLocked should not record the snapshot or account file. Replay must not rebuild protection from a batch that dropped a mo_snapshots, PITR, ISCP, or table row, and it must not panic on a short column after the writer reported success.
Steps to Reproduce
Code path, not a one-shot SQL script.
- Let checkpoint GC run
scanCheckpointsLockedwith a non-emptySnapshotMeta(objects,pitr.objects, oriscp.objects, andtables). - Drive
GlobalCapso oneAppendBytes/AppendFixedinsideSaveMetaorSaveTableInforeturnsMPoolCapacity.DebugAllocatoris off-heap. - Observe
WriteEndstill return nil andsaveSnapshotstill record the file. - Restart the TN. Replay
ReadMeta/ReadTableInfo(checkpoint.go477–518) rebuilds from that file. A failed column-0 append omits the object or table. A later-column failure panics inRebuild/RebuildTableInfoinstead of surfacing the allocation error. - The next GC cycle uses the short snapshot and PITR lists. A dropped table whose snapshot row lived in the omitted object is removed by
MergeTableInfo, andObjectIsSnapshotRefersdoes not keep its data objects.
Additional information
Searched open issues for SaveMeta, SaveTableInfo, SnapshotMeta, DebugAllocator, and AppendFixed GC checkpoint. The hits were #29263, #29258, #29257, and an unrelated compatibility issue. None describe this writer.
prepareCNMeta in ckp_writer.go ignores the same append calls, but it is only reached from MockCheckpointV12 (db/test/db_test.go). This report is the production SaveMeta / SaveTableInfo path.
Activity
XuPeng-SH commentedon Oct 22, 2026
This report is now tracked together with #29261. The canonical issue retains explicit acceptance cases for the behavior described here. This is an administrative duplicate/consolidation closure only; the underlying defect is not claimed fixed. The original description and discussion remain available on this issue.