{"record":{"id":"451e3732f8efea1b","repo":"risingwavelabs/risingwave","slug":"meta-client-is-required-for-iceberg-pk-index-compa","errorCode":null,"errorMessage":"meta client is required for iceberg pk-index compaction resolver","messagePattern":"meta client is required for iceberg pk-index compaction resolver","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/stream/src/from_proto/iceberg_with_pk_index/compaction_resolver.rs","lineNumber":78,"sourceCode":"        let pk_data_types = node\n            .pk_columns\n            .iter()\n            .map(|column| {\n                column\n                    .column_desc\n                    .as_ref()\n                    .map(ColumnDesc::from)\n                    .map(|column| column.data_type)\n                    .ok_or_else(|| anyhow!(\"compaction resolver PK column missing column_desc\"))\n            })\n            .collect::<Result<Vec<_>, _>>()?;\n\n        let barrier_receiver = params\n            .local_barrier_manager\n            .subscribe_barrier(params.actor_context.id);\n        let local_barrier_manager = params.local_barrier_manager.clone();\n        let meta_client = params.env.meta_client().ok_or_else(|| {\n            anyhow!(\"meta client is required for iceberg pk-index compaction resolver\")\n        })?;\n        let exec = CompactionResolverExecutor::new(\n            params.actor_context,\n            sink_id,\n            iceberg_config,\n            pk_indices,\n            pk_data_types,\n            params.config.developer.chunk_size,\n            local_barrier_manager,\n            barrier_receiver,\n            meta_client,\n        );\n        Ok((params.info, exec).into())\n    }\n}\n","sourceCodeStart":60,"sourceCodeEnd":94,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/stream/src/from_proto/iceberg_with_pk_index/compaction_resolver.rs#L60-L94","documentation":"The iceberg pk-index compaction resolver executor requires a meta client to coordinate compaction via the meta service. During stream executor construction (`new_boxed_executor`), the code reads `params.env.meta_client()` and fails fast with this anyhow error when the environment has no meta client (e.g. embedded/test mode or a misconfigured compute node). This is a startup-time guard: the executor cannot function without cluster coordination.","triggerScenarios":"Building an `IcebergWithPkIndexCompactionResolver` proto node into an executor when `params.env.meta_client()` returns `None` — i.e. the compute node's environment was constructed without a meta client, typically in unit tests, embedded runtimes, or when the stream env was built with meta client disabled.","commonSituations":"Running a stream graph containing an Iceberg sink with primary key in an embedded/test harness without meta; launching risectl/local simulation where `env.meta_client()` is None; misconfigured compute-node startup that skips meta client construction.","solutions":["Run the compute node against a real RisingWave cluster so `env.meta_client()` is populated (proper risedev profile, e.g. `./risedev d`).","If in tests, provide a mock/in-memory meta client when building the stream environment instead of omitting it.","Verify the executor env construction path passes a meta client for sinks requiring cluster coordination.","If the sink is not needed, remove the Iceberg pk-index sink from the streaming graph."],"exampleFix":"// before\nlet env = StreamEnvironment::new(config, None); // no meta client\n// after\nlet env = StreamEnvironment::new(config, Some(Arc::new(MetaClient::new(...))));","handlingStrategy":"validation","validationCode":"// before building the executor\nassert!(params.env.meta_client().is_some(), \"this graph requires a meta client environment\");","typeGuard":"fn has_meta_client(env: &StreamEnvironment) -> bool { env.meta_client().is_some() }","tryCatchPattern":"match env.meta_client() { Some(c) => build_with(c), None => return Err(anyhow!(\"meta client is required for iceberg pk-index compaction resolver\")) }","preventionTips":["Always run Iceberg pk sinks inside a real cluster profile (`./risedev d`), not bare test envs.","In tests, use environment builders that inject a mock meta client.","Add a startup check that logs when a graph contains pk-index sinks but no meta client."],"tags":["rust","streaming","iceberg","meta-client"],"backgroundTag":"missing-dependency","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-14T11:17:12.474Z"}