Skip to content

Commit

Permalink
Fix range in clearExtraData (#278)
Browse files Browse the repository at this point in the history
* Fix range in clearExtraData
  • Loading branch information
JGEthanChen authored Jul 6, 2022
1 parent d975005 commit 28f1258
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kv/raftstore/peer_storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ func (ps *PeerStorage) clearExtraData(newRegion *metapb.Region) {
if bytes.Compare(oldStartKey, newStartKey) < 0 {
ps.clearRange(newRegion.Id, oldStartKey, newStartKey)
}
if bytes.Compare(newEndKey, oldEndKey) < 0 {
if bytes.Compare(newEndKey, oldEndKey) < 0 || (len(oldEndKey) == 0 && len(newEndKey) != 0) {
ps.clearRange(newRegion.Id, newEndKey, oldEndKey)
}
}
Expand Down

0 comments on commit 28f1258

Please sign in to comment.