TiFlash v8.5.8: MergeDelta repeatedly fails with “invalid field index” after a zero-length partial Page read, including after restart

未关闭
#11,237 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
4/5
预计耗时
3-5 天
新手友好度
35/100
Issue 类型
缺陷
描述清晰度
基本清楚
活跃度
活跃
技术栈
cpp
领域
backend, databases

调研方向

Start with the reported read path: Segment::prepareMergeDelta through ColumnFileTiny::fillColumns to Page::getFieldData, then inspect the zero-length branch in BlobStore.cpp around line 891. Compare the persisted PageEntry field offsets with the ColumnFileTiny schema metadata for the referenced Page, using read-only diagnostics before recovery. The issue is resolved when the evidence distinguishes those causes and identifies which Page and schema metadata to preserve.

由索引模型根据 Issue 内容生成。

描述

contribution

Background MergeDelta repeatedly failed on the same Segment and Page on one TiFlash instance. We counted 2,260 failed attempts in approximately 30 minutes. The same Segment, Page and field-index error appeared again within seconds of a subsequent TiFlash restart.

Environment: TiFlash v8.5.8, engine Git hash reported at restart 3abdec8bff315647a056e6bf910abd4b59af2011, Linux x86-64.

Observed errors (identifiers redacted consistently):

BlobStore.cpp:891
Reading with fields but entry size is 0
  page_id=<TABLE_A>.<PAGE_A>
  fields=[1, 2]
  PageEntry.size=365272
  field_offsets begins with [0, 0, 0, 0, ...]

DeltaMergeStore_InternalBg.cpp:452
Execute task on segment failed, task=MergeDelta
  segment_id=<SEGMENT_A>
  Try to getFieldData with invalid field index
  [page_id=<PAGE_A>] [valid=true] [field_index=2]

Failing read path (selected frames):

Segment::prepareMergeDelta
  → Segment::ensurePlace
  → ColumnFileSetReader::readPKVersion
  → ColumnFileTiny::fillColumns
  → Page::getFieldData(2)

The logged PageEntry had a nonzero total size. The zero-length warning occurred on the partial read for fields [1, 2]. In the corresponding BlobStore source, the zero-length branch returns a Page with empty data and no populated field offsets. This explains the subsequent lookup failure. We have not determined how the stored field offsets were produced.

Observed impact: Across three samples spanning about five and a half minutes, Delta rows on the affected Segment increased by 665, reaching approximately 673,000 rows and 463 MiB. The logical Delta ColumnFile count increased by 425, reaching approximately 226,000. The Segment epoch and Stable row count stayed constant across these samples.

Reproduction: The existing affected replica reproduced the error across a process restart. We do not have a procedure to create the original Page state on a fresh cluster.

What read-only diagnostics would help distinguish a problem in the persisted PageEntry field offsets from a mismatch between ColumnFileTiny schema metadata and the referenced Page? We would also appreciate guidance on which Page and schema metadata to preserve before attempting replica recovery.

主要语言
C++
星标
1k
派生
428
平均合并
2 天 7 小时
30 天内合并 PR
100

环境准备

在 Codespaces 中打开

在浏览器里用你自己的 GitHub 账号启动这个项目的开发容器。

  • 没有 Dockerfile 或 Docker Compose 文件
  • 有 Pull Request 模板
  • 没有贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

pingcap/tiflash 的其他 Issue

查看 pingcap/tiflash 的全部 Issue

相似的 Issue

更多 C++ Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。