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() での現在のスキーマの確認が、このインデックスをどのように使っているかを確認してください。RemoveSchemas({1}) の後に SetCurrentSchema(1) が失敗し、同じスキーマを 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++
- スター
- 228
- フォーク
- 136
- 平均マージ
- 5日 19時間
- マージ済み PR(30日)
- 53
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
apache/iceberg-cpp のほかの issue
-
難易度 5/5 1週間以上 初心者へのやさしさ 12/100
apache/iceberg-cpp#1027 ·
メンテナーはふだん 2 日以内に返信
-
bug: gzip table metadata is neither written nor detected as gzip対応中かも @LuciferYang が 4 日前に担当しました。 オープン
難易度 3/5 1〜2日 初心者へのやさしさ 66/100
apache/iceberg-cpp#1013 ·
メンテナーはふだん 2 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 35/100
apache/iceberg-cpp#1000 · コメント 2 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 8/100
apache/iceberg-cpp#988 · コメント 2 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 20/100
apache/iceberg-cpp#959 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
apache/iceberg-cpp の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
content good first issue
難易度 1/5 1時間未満 初心者へのやさしさ 95/100
cpinitiative/usaco-guide#6699 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 65/100
codepointerapp/codepointer#231 ·
-
enhancement source/qq
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
metasequoiaime/msime-windows#1054 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
amnezia-vpn/amnezia-client#3297 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信