Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

bug: TableMetadataBuilder::RemoveSchemas leaves removed ids in the schema index

Aperta Adatta ai principianti
#1,011 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@LuciferYang ci sta già lavorando.

Dal 14/10/2026.

  • #1012 di @LuciferYang — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
72/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
cpp

Direzione di ricerca

Parti dall'implementazione di TableMetadataBuilder::Impl::RemoveSchemas, dove metadata_.schemas viene filtrato ma schemas_by_id_ no. Controlla come SetCurrentSchema, AddSchema e il controllo dello schema corrente in Build() usano questo indice. Il lavoro è completo quando, dopo RemoveSchemas({1}), SetCurrentSchema(1) fallisce e AddSchema dello stesso schema lo riaggiunge, con un test che copra entrambi i casi.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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:

  1. RemoveSchemas({1}) followed by SetCurrentSchema(1) succeeds, and Build() returns metadata with current-schema-id: 1 while schemas no longer contains schema 1.
  2. RemoveSchemas({1}) followed by AddSchema of the same schema finds it through the stale index and skips re-adding it to schemas.

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.

Lingua principale
C++
Stelle
228
Fork
136
Merge medio
5g 22h
PR unite (30g)
52

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/iceberg-cpp

Tutte le issue di apache/iceberg-cpp

Issue simili

Altre issue su C++

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.