{"record":{"id":"a832f715cbebf805","repo":"risingwavelabs/risingwave","slug":"barrier-read-is-unavailable-for-now-likely-the-cl","errorCode":null,"errorMessage":"Barrier read is unavailable for now. Likely the cluster is recovering","messagePattern":"Barrier read is unavailable for now\\. Likely the cluster is recovering","errorType":"exception","errorClass":"HummockError","httpStatus":null,"severity":"warning","filePath":"src/storage/src/hummock/error.rs","lineNumber":63,"sourceCode":"    #[error(\"SharedBuffer error: {0}\")]\n    SharedBufferError(String),\n    #[error(\"Wait epoch error: {0}\")]\n    WaitEpoch(String),\n    #[error(\"Next epoch error: {0}\")]\n    NextEpoch(String),\n    #[error(\"Change log retention miss: table {table_id}, epoch {epoch}\")]\n    ChangeLogRetentionMiss { table_id: TableId, epoch: u64 },\n    #[error(\"Time-travel version expired: table {table_id}, epoch {epoch}\")]\n    TimeTravelVersionExpired { table_id: TableId, epoch: u64 },\n    #[error(\n        \"Committed epoch mismatch: table {table_id}, committed_epoch {committed_epoch}, read_epoch {read_epoch}\"\n    )]\n    CommittedEpochMismatch {\n        table_id: TableId,\n        committed_epoch: u64,\n        read_epoch: u64,\n    },\n    #[error(\"Barrier read is unavailable for now. Likely the cluster is recovering\")]\n    ReadCurrentEpoch,\n    #[error(\"CompactionExecutor error: {0}\")]\n    CompactionExecutor(String),\n    #[error(\"FileCache error: {0}\")]\n    FileCache(String),\n    #[error(\"SstObjectIdTracker error: {0}\")]\n    SstObjectIdTrackerError(String),\n    #[error(\"CompactionGroup error: {0}\")]\n    CompactionGroupError(String),\n    #[error(\"SstableUpload error: {0}\")]\n    SstableUploadError(String),\n    #[error(\"Read backup error: {0}\")]\n    ReadBackupError(String),\n    #[error(\"Foyer error: {0}\")]\n    FoyerError(#[from] foyer::Error),\n    #[error(\"Other error: {0}\")]\n    Other(String),\n}","sourceCodeStart":45,"sourceCodeEnd":81,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/storage/src/hummock/error.rs#L45-L81","documentation":"A barrier read was requested but no barrier is currently readable: the caller asked for the current/barrier epoch before the Hummock version has been updated by any barrier. Hummock returns this via `HummockError::read_current_epoch()` to signal a transient state — typically the cluster is starting up, restarting, or recovering and has not yet sealed a barrier. It is expected to clear once the meta node delivers the next barrier and the storage version advances.","triggerScenarios":"Calling APIs that read the current epoch/barrier (e.g. `HummockError::read_current_epoch()` from `src/storage/src/hummock/error.rs:145`) before the first barrier has been applied, or during a window where barrier delivery is stalled/recovering.","commonSituations":"Query issued immediately after cluster startup or crash recovery before barriers flow again; a stalled barrier due to slow sources or an unhealthy actor blocking the barrier loop; failover of the meta service leaving a gap in barrier progression.","solutions":["Retry the read after a short backoff — the error is transient by design.","Check barrier progress (barrier-complete latency / `await_epoch` metrics or logs) to confirm the cluster has sealed a barrier.","If it persists, investigate source connectivity or actor failures stalling barrier delivery; restart/recover the affected components.","During automated probing, add retry-with-backoff around barrier reads instead of failing immediately."],"exampleFix":"// before: single attempt, fails during recovery\nlet epoch = hummock.read_current_epoch()?;\n// after: retry until a barrier is readable\nloop {\n    match hummock.read_current_epoch() {\n        Err(e) if matches!(e.inner(), HummockErrorInner::ReadCurrentEpoch) => {\n            tokio::time::sleep(Duration::from_millis(500)).await;\n        }\n        other => break other.map(|v| v),\n    }\n}","handlingStrategy":"retry","validationCode":"// Check cluster health before barrier reads:\n// let ready = risingwave_healthcheck() && barrier_probe_ok();","typeGuard":null,"tryCatchPattern":"match err.inner() {\n    HummockErrorInner::ReadCurrentEpoch => {\n        // transient: retry with exponential backoff until a barrier is sealed\n    }\n    _ => return Err(err),\n}","preventionTips":["Always wrap barrier/current-epoch reads in retry-with-backoff; they are transient during recovery.","Delay application start until barrier-complete metrics confirm barriers are flowing.","Alert on barrier stall duration, not on individual ReadCurrentEpoch occurrences.","Avoid running reads immediately after cluster startup before the first barrier."],"tags":["storage","hummock","barrier","transient","recovery"],"backgroundTag":"request-timeout","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"}