risingwavelabs/risingwave · error · SinkError::LanceDb
error acquiring lance dataset guard: {e}
Error message
error acquiring lance dataset guard: {e} What it means
RisingWave's LanceDB sink wraps the underlying Lance dataset access in an async guard; if the tokio watch/oneshot handle fails (the dataset holder was dropped or closed), the guard cannot be acquired and the sink fails while resolving the dataset URI. This typically indicates an internal lifecycle problem in the sink writer rather than a user config issue.
Source
Thrown at src/connector/src/sink/lancedb.rs:117
async fn open_table(&self, conn: &LanceDbConnection) -> Result<LanceDbTable> {
conn.open_table(&self.table)
.execute()
.await
.context("failed to open LanceDB table")
.map_err(SinkError::LanceDb)
}
/// Get the Lance dataset URI from the opened native `LanceDB` table.
async fn dataset_uri(&self, table: &LanceDbTable) -> Result<String> {
let dataset_wrapper = table.dataset().ok_or_else(|| {
SinkError::LanceDb(anyhow!(
"failed to get underlying lance Dataset (table may be remote)"
))
})?;
let dataset_guard = dataset_wrapper
.get()
.await
.map_err(|e| SinkError::LanceDb(anyhow!(e)))?;
Ok(dataset_guard.uri().to_owned())
}
}
#[serde_as]
#[derive(Clone, Debug, Deserialize, WithOptions)]
pub struct LanceDbConfig {
#[serde(flatten)]
pub common: LanceDbCommon,
pub r#type: String,
/// Whether to use RisingWave's two-phase commit framework for exactly-once commits.
/// Defaults to true. Set to false to use single-phase commits.
#[serde_as(as = "Option<DisplayFromStr>")]
pub is_exactly_once: Option<bool>,
}
View on GitHub (pinned to 6469eb736d)
Solutions
- Retry the operation; this is usually a transient lifecycle race during sink restart/failover
- Check sink logs for earlier errors that caused the writer/dataset holder to be dropped
- Upgrade RisingWave; if reproducible on every start, file a bug with the full log
- Verify the sink is not being dropped/deleted concurrently by another session
Defensive patterns
Strategy: retry
Try / catch
match sink_result { Err(e) if e.to_string().contains("error acquiring lance dataset guard") => retry_with_backoff(), Err(e) => fail(e), Ok(v) => v } Prevention
- Avoid deleting/dropping the sink while it is actively validating
- Check logs for prior writer teardown errors
- Retry sink creation on transient failures
When it happens
Trigger: Calling LanceDbCommon::dataset_uri (used to resolve the table's storage location) when dataset.get().await fails because the dataset holder task/channel has been dropped or closed before the read completes.
Common situations: The sink writer was torn down concurrently (e.g., during failover or sink drop) while another component still tried to read the dataset URI; an internal race during connector shutdown or schema validation.
Understand the failure class
Background: "This is a bug, please report it": internal invariant violations, unreachable panics, and SNH errors explained — this error's family across 47 libraries.
Related errors
- only append-only LanceDB sink is supported
- Columns mismatch. RisingWave schema has {} fields, LanceDB t
- (dataset guard acquisition error)
- Lance fragment write task stopped before accepting a record
- failed to read Lance transaction history
AI-assisted analysis of risingwavelabs/risingwave@6469eb736d (2026-09-11).
Data as JSON: /api/errors/c025b34ba71d48ac.
Report an issue: GitHub.