Skip to content

Commit ee3b743

Browse files
LiuRuoyu01ketor
authored andcommitted
[fix][sdk]Add range checking
1 parent 5b135de commit ee3b743

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/coordinator/coordinator_control_coor.cc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5842,6 +5842,11 @@ butil::Status CoordinatorControl::ScanRegions(const std::string& start_key, cons
58425842
continue;
58435843
}
58445844
}
5845+
CHECK(upper_bound > region_internal.definition().range().start_key())
5846+
<< fmt::format("end_key should greater than region_start_key, range: [{}, {}], region_range: [{}, {}]",
5847+
Helper::StringToHex(lower_bound), Helper::StringToHex(upper_bound),
5848+
Helper::StringToHex(region_internal.definition().range().start_key()),
5849+
Helper::StringToHex(region_internal.definition().range().end_key()));
58455850

58465851
regions.push_back(region_internal);
58475852

0 commit comments

Comments
 (0)