bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema index
維護者通常 2 天內回覆
評估
- 難度
- 2/5
- 預估耗時
- 1-3 小時
- 新手友好度
- 72/100
- Issue 類型
- 缺陷
- 描述清晰度
- 描述清楚
- 活躍度
- 活躍
- 技術堆疊
- cpp
研究方向
從 TableMetadataBuilder::Impl::RemoveSchemas 的實作開始,這裡會過濾 metadata_.schemas,但不會處理 schemas_by_id_。檢查 SetCurrentSchema、AddSchema 以及 Build() 中的目前 schema 檢查是如何使用該索引的。完成的標準是:呼叫 RemoveSchemas({1}) 後,SetCurrentSchema(1) 會失敗,並且對同一個 schema 呼叫 AddSchema 會將其重新加入,同時有測試涵蓋這兩種情況。
由索引模型根據 Issue 內容生成。
描述
Summary
TableMetadataBuilder::Impl::RemoveSchemas filters metadata_.schemas but never touches schemas_by_id_. Within the same builder the removed ids stay resolvable, so Build() can produce metadata whose current-schema-id points at a schema that is no longer in schemas.
Root cause
SetCurrentSchema checks the id against schemas_by_id_, and the current-schema check in Build() uses the same index. Both still find the removed schema, so:
RemoveSchemas({1})followed bySetCurrentSchema(1)succeeds, andBuild()returns metadata withcurrent-schema-id: 1whileschemasno longer contains schema 1.RemoveSchemas({1})followed byAddSchemaof the same schema finds it through the stale index and skips re-adding it toschemas.
Impact
InMemoryCatalog::CommitTable and SqlCatalog::CommitTable apply the caller's update list on one builder, then Build() and write the result. A commit carrying [remove-schemas, set-current-schema] for the same id is enough to write that metadata file, and reading it back fails with Cannot find schema with current-schema-id=..., so the table can no longer be loaded.
Java's Builder.removeSchemas does not update schemasById either, so this is stricter than Java's builder.
Proposed fix
Erase the removed ids from schemas_by_id_ alongside the existing filter of metadata_.schemas.
Out of scope
RemovePartitionSpecs has the same gap with specs_by_id_. Follow-up.
- 主要語言
- C++
- 星號
- 226
- 分支
- 133
- 平均合併
- 6 天 2 小時
- 30 天內合併 PR
- 49
環境準備
這個專案沒有提供開發容器、Dockerfile 或貢獻指南,環境需要你自己搭建:先看它的 README,通用步驟見我們的新手貢獻指南。
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
apache/iceberg-cpp 的其他 Issue
-
bug: gzip table metadata is neither written nor detected as gzip可能已有人在做 @LuciferYang 於 2 天前認領。 未關閉
難度 3/5 1-2 天 新手友好度 66/100
apache/iceberg-cpp#1013 ·
維護者通常 2 天內回覆
-
Big-endian compatibility failures in bucket hashing and Avro/deletion-vector serialization可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 4/5 3-5 天 新手友好度 35/100
apache/iceberg-cpp#1000 · 2 則留言 · 1 個 reaction ·
維護者通常 2 天內回覆
-
Support Iceberg table encryption (Java-compatible)可能已有人在做 關聯的 PR 仍在進行中或已合併。 未關閉
難度 5/5 一週以上 新手友好度 8/100
apache/iceberg-cpp#988 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 20/100
apache/iceberg-cpp#959 · 1 則留言 ·
維護者通常 2 天內回覆
-
難度 5/5 一週以上 新手友好度 35/100
apache/iceberg-cpp#946 · 6 則留言 ·
維護者通常 2 天內回覆
查看 apache/iceberg-cpp 的全部 Issue
相似的 Issue
-
難度 2/5 1-3 小時 新手友好度 66/100
-
難度 2/5 1-3 小時 新手友好度 62/100
NVIDIA-RTX/NRI#277 ·
維護者通常 1 天內回覆
-
os:Linux
難度 2/5 1-3 小時 新手友好度 72/100
維護者通常 1 天內回覆
-
難度 2/5 1-3 小時 新手友好度 76/100
-
acceptable_buffer_backends: unknown backend names are silently ignored可能已有人在做 @mini-1235 今天認領。 未關閉
難度 2/5 1-3 小時 新手友好度 70/100
ros2/rmw_fastrtps#945 ·
維護者通常 1 天內回覆