diff --git a/src/datanode/src/alive_keeper.rs b/src/datanode/src/alive_keeper.rs index 5f5fe9be1395..ae6e18a989c6 100644 --- a/src/datanode/src/alive_keeper.rs +++ b/src/datanode/src/alive_keeper.rs @@ -461,8 +461,8 @@ mod test { // wait for countdown task to finish let before_await = Instant::now(); let (finish_instant, result) = rx.await.unwrap(); - // the mock region server cannot close the region - assert_eq!(result, Some(false)); + // it returns `RegionNotFound` + assert_eq!(result, Some(true)); // this task should be finished after 5 * heartbeat_interval_millis // we assert 4 times here assert!( diff --git a/src/datanode/src/error.rs b/src/datanode/src/error.rs index 62828c996f24..3eb3d232c5aa 100644 --- a/src/datanode/src/error.rs +++ b/src/datanode/src/error.rs @@ -518,11 +518,12 @@ impl ErrorExt for Error { | MissingInsertBody { .. } | ShutdownInstance { .. } | JoinTask { .. } - | RegionNotFound { .. } | RegionEngineNotFound { .. } | UnsupportedOutput { .. } | GetRegionMetadata { .. } => StatusCode::Internal, + RegionNotFound { .. } => StatusCode::RegionNotFound, + StartServer { source, .. } | ShutdownServer { source, .. } | WaitForGrpcServing { source, .. } => source.status_code(),