return region error when TiKV is closing
@@ -1892,6 +1892,13 @@ fn extract_region_error<T>(res: &storage::Result<T>) -> Option<RegionError> {
err.set_server_is_busy(server_is_busy_err);
Some(err)
}
+ Err(Error::Closed) => {
+ // TiKV is closing, return an RegionError to tell the client that this region is unavailable
+ // temporarily, the client should retry the request in other TiKVs.
+ let mut err = RegionError::new();
+ err.set_message("TiKV is Closing".to_string());
+ Some(err)
+ }
_ => None,
}
}
