Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

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

Offen Anfängerfreundlich
#1,011 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@LuciferYang arbeitet bereits daran.

Seit 14.10.2026.

  • #1012 von @LuciferYang — offen

Bewertung

Schwierigkeit
2/5
Geschätzter Aufwand
1-3 Stunden
Anfängerfreundlichkeit
72/100
Issue-Typ
Bug
Klarheit
Klar beschrieben
Aktivitätsstatus
Aktiv
Tech-Stack
cpp

Rechercherichtung

Beginne in der Implementierung von TableMetadataBuilder::Impl::RemoveSchemas, wo metadata_.schemas gefiltert wird, schemas_by_id_ aber nicht. Prüfe, wie SetCurrentSchema, AddSchema und die Prüfung des aktuellen Schemas in Build() diesen Index verwenden. Fertig ist, wenn nach RemoveSchemas({1}) der Aufruf SetCurrentSchema(1) fehlschlägt und AddSchema mit demselben Schema es wieder hinzufügt, mit einem Test, der beide Fälle abdeckt.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

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.

Vorherrschende Sprache
C++
Sterne
226
Forks
133
Ø Merge
6 T. 5 Std.
Gemergte PRs (30 T.)
40

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus apache/iceberg-cpp

Alle Issues in apache/iceberg-cpp

Ähnliche Issues

Weitere Issues zu C++

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.