Make RestCatalog safe to share across threads

Offen
#1,091 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

Maintainer antworten meist innerhalb von 2 Tagen

@smaheshwar-pltr arbeitet bereits daran.

Seit 04.11.2026.

  • #1092 von @smaheshwar-pltr — offen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
25/100
Issue-Typ
Bug
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
cpp
Bereich
backend

Rechercherichtung

Read src/iceberg/catalog/rest/rest_catalog.cc around AsCatalog() at lines 565–573, then inspect the HttpClient path and the linked issue #1089 to understand the shared request state. Make the default catalog cache safe for concurrent access and confirm the linked HTTP client work supports sharing; done means concurrent catalog use has no data race. An open pull request, #1092, is already linked.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

Currently, RestCatalog doesn't document whether one instance can be shared between threads. Query engines usually share one catalog across concurrent queries (for example Spark within a session, Trino, and DuckDB), and iceberg-rust requires catalogs to be Send + Sync (code).

Without that guarantee, an embedder has to serialize every catalog call behind its own lock. That costs throughput, and one hung request then blocks every other caller. In https://github.com/smaheshwar-pltr/duckdb-proto-iceberg, we observed that making a catalog-heavy test about 4x slower.

RestCatalog is close to thread-safe already. After Make(), the only state it changes is the default catalog that AsCatalog() caches in a weak_ptr. It reads and writes that cache without a lock, so concurrent AsCatalog() calls race (rest_catalog.cc#L565-L573).

Note: sharing a catalog also depends on https://github.com/apache/iceberg-cpp/issues/1089, because every request goes through one HttpClient.

Vorherrschende Sprache
C++
Sterne
227
Forks
142
Ø Merge
3 T. 21 Min.
Gemergte PRs (30 T.)
70

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.