{"record":{"id":"27243fd1e8966c1f","repo":"tikv/tikv","slug":"failed-to-get-value-of-key-in-region","errorCode":null,"errorMessage":"failed to get value of key {} in region {}: {:?}","messagePattern":"failed to get value of key (.+?) in region (.+?): (.+?)","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"components/raftstore/src/store/region_snapshot.rs","lineNumber":306,"sourceCode":"        )\n        .map_err(|e| EngineError::Other(box_err!(e)))?;\n        let data_key = keys::data_key(key);\n        self.snap\n            .get_value_cf_opt(opts, cf, &data_key)\n            .map_err(|e| self.handle_get_value_error(e, cf, key))\n    }\n}\n\nimpl<S> RegionSnapshot<S>\nwhere\n    S: Snapshot,\n{\n    #[inline(never)]\n    fn handle_get_value_error(&self, e: EngineError, cf: &str, key: &[u8]) -> EngineError {\n        CRITICAL_ERROR.with_label_values(&[\"rocksdb get\"]).inc();\n        if panic_when_unexpected_key_or_data() {\n            set_panic_mark();\n            panic!(\n                \"failed to get value of key {} in region {}: {:?}\",\n                log_wrappers::Value::key(key),\n                self.region.get_id(),\n                e,\n            );\n        } else {\n            error!(\n                \"failed to get value of key in cf\";\n                \"key\" => log_wrappers::Value::key(key),\n                \"region\" => self.region.get_id(),\n                \"cf\" => cf,\n                \"error\" => ?e,\n            );\n            e\n        }\n    }\n}\n","sourceCodeStart":288,"sourceCodeEnd":324,"githubUrl":"https://github.com/tikv/tikv/blob/78aedc1c81ef3f7d8bacc6e9d09f56460f134937/components/raftstore/src/store/region_snapshot.rs#L288-L324","documentation":"A point get in a region snapshot failed at the RocksDB layer; handle_get_value_error increments the CRITICAL_ERROR 'rocksdb get' counter and, when panic_when_unexpected_key_or_data is enabled (test/diagnostic config), sets a panic mark and panics with the key and region. Outside that mode it converts to an EngineError.","triggerScenarios":"Thrown at components/raftstore/src/store/region_snapshot.rs:306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the underlying EngineError for RocksDB corruption or IO failure","Disable panic_when_unexpected_key_or_data in production so the error propagates as a retryable region error"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"78aedc1c81ef3f7d8bacc6e9d09f56460f134937","analyzedAt":"2026-09-03T23:31:32.398Z","contentChangedAt":"2026-09-03T23:31:32.398Z","schemaVersion":2},"datasetVersion":"2026-09-11T07:07:21.782Z"}