Why it matters

Metadata staleness is the top operational pain point in Impala. Understanding how Catalog sync works tells you exactly when INVALIDATE METADATA is needed and when it isn't.

Advertisement

The architecture

Statestore hosts named topics. Each topic is a set of key-value entries. Subscribers (Impalads, Catalog) subscribe to topics they care about. When any subscriber updates a topic entry, Statestore broadcasts the delta to every other subscriber.

Two critical topics: impala-membership tracks which Impalads are alive; catalog-update carries metadata deltas from Catalog to Impalads.

Metadata propagation flowMetastoresource of truthCatalog servicecache + deltaImpaladsconsume deltasCatalog watches metastore, produces deltas, Statestore broadcasts, Impalads apply
Metadata sync via Statestore topics.
Advertisement

How it works end to end

Catalog service maintains an in-memory copy of the entire metastore state. It periodically polls for changes (via metastore notifications when configured) and computes deltas.

Deltas are published to the catalog-update topic. Statestore broadcasts to subscribed Impalads. Each Impalad applies the delta to its own local catalog cache.

DDL from clients: client issues DDL to any Impalad; Impalad forwards to Catalog; Catalog executes DDL against metastore; Catalog computes and publishes delta; every Impalad receives the update.

External DDL (via Hive/Spark) bypasses Catalog. Catalog will eventually detect it via periodic refresh, but until then Impalads may have stale metadata. INVALIDATE METADATA forces immediate refresh.