fix: save code in debug_assert! (#3137)

fix: save code in debug_assert!
This commit is contained in:
Weny Xu
2024-01-11 15:07:08 +09:00
committed by GitHub
parent 29a7f301df
commit 312e8e824e
3 changed files with 6 additions and 6 deletions

View File

@@ -60,13 +60,13 @@ impl UpdateMetadata {
.await
.context(error::TableMetadataManagerSnafu)
{
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
return error::RetryLaterSnafu {
reason: format!("Failed to update the table route during the downgrading leader region, error: {err}")
}.fail();
}
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
Ok(())
}

View File

@@ -44,13 +44,13 @@ impl UpdateMetadata {
.await
.context(error::TableMetadataManagerSnafu)
{
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
return error::RetryLaterSnafu {
reason: format!("Failed to update the table route during the rollback downgraded leader region, error: {err}")
}.fail();
}
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
Ok(())
}

View File

@@ -167,13 +167,13 @@ impl UpdateMetadata {
.await
.context(error::TableMetadataManagerSnafu)
{
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
return error::RetryLaterSnafu {
reason: format!("Failed to update the table route during the upgrading candidate region, error: {err}")
}.fail();
};
debug_assert!(ctx.remove_table_route_value());
ctx.remove_table_route_value();
// Consumes the guard.
ctx.volatile_ctx.opening_region_guard.take();