Skip to content

Commit

Permalink
fix: save code in debug_assert! (GreptimeTeam#3137)
Browse files Browse the repository at this point in the history
fix: save code in debug_assert!
  • Loading branch information
WenyXu authored Jan 11, 2024
1 parent 29a7f30 commit 312e8e8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand Down

0 comments on commit 312e8e8

Please sign in to comment.