{"record":{"id":"903fccdc65375de9","repo":"risingwavelabs/risingwave","slug":"integrity-check-failed","errorCode":null,"errorMessage":"Integrity check failed","messagePattern":"Integrity check failed","errorType":"error_code","errorClass":"MetaError","httpStatus":null,"severity":"critical","filePath":"src/meta/src/error.rs","lineNumber":135,"sourceCode":"    #[error(\"Sink error: {0}\")]\n    Sink(\n        #[from]\n        #[backtrace]\n        SinkError,\n    ),\n\n    #[error(transparent)]\n    Internal(\n        #[from]\n        #[backtrace]\n        anyhow::Error,\n    ),\n\n    // Indicates that recovery was triggered manually.\n    #[error(\"adhoc recovery triggered\")]\n    AdhocRecovery,\n\n    #[error(\"Integrity check failed\")]\n    IntegrityCheckFailed,\n\n    #[error(\"{0} has been deprecated, please use {1} instead.\")]\n    Deprecated(String, String),\n\n    #[error(transparent)]\n    NotImplemented(#[from] NotImplemented),\n\n    #[error(\"Secret error: {0}\")]\n    SecretError(\n        #[from]\n        #[backtrace]\n        SecretError,\n    ),\n}\n\nimpl MetaError {\n    /// Provide the Postgres error code for the error.","sourceCodeStart":117,"sourceCodeEnd":153,"githubUrl":"https://github.com/risingwavelabs/risingwave/blob/6469eb736d691e8e9b8a419a57edd6429ca77417/src/meta/src/error.rs#L117-L153","documentation":"MetaError::IntegrityCheckFailed indicates that a metadata integrity verification failed on the meta node. The catalog/integrity checker validates invariants between internal metadata models (e.g. streaming job fragments, tables, sink references); when an invariant is broken (dangling references, inconsistent states), this error is produced so operators know the metadata store is inconsistent and may need manual repair.","triggerScenarios":"Running the metadata integrity check routine in the meta service (`catalog::integrity_check` / verify_metadata_invariants) on a cluster whose metadata has dangling objects, orphaned fragments, or partially-created jobs (e.g. after a crash mid-DDL or a manual meta store edit).","commonSituations":"Crash during DDL (table/mv/sink creation or deletion) leaving orphan records; manual edits to the metadata database; version-upgrade migrations leaving stale entries; bugs in concurrent DDL handling.","solutions":["Read the integrity checker logs to identify which invariant and objects failed","Back up the metadata database before any manual repair","Remove/repair the orphaned or inconsistent metadata entries identified by the checker","Re-run the integrity check to confirm the metadata is clean","Report to RisingWave maintainers with logs if this arises without manual intervention"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Run the built-in integrity check proactively after crash/upgrade\n// (meta service routine)\nif let Err(e) = meta_service.run_integrity_check().await {\n    tracing::error!(\"metadata inconsistent: {e}\");\n    // alert and take meta store backup before repair\n}","typeGuard":"fn is_integrity_failure(e: &MetaError) -> bool {\n    matches!(e, MetaError::IntegrityCheckFailed)\n}","tryCatchPattern":null,"preventionTips":["Never hand-edit the metadata database","Take a meta store backup/snapshot before upgrades","Avoid force-killing the meta node during DDL; drain first","Run integrity checks after unclean shutdowns or version upgrades"],"tags":["metadata","integrity","meta-node"],"backgroundTag":"internal-invariant-violation","analyzedSha":"6469eb736d691e8e9b8a419a57edd6429ca77417","analyzedAt":"2026-09-11T21:06:21.487Z","contentChangedAt":"2026-09-11T21:06:21.487Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}