From 28f12587cb20bacba07481a986d367b0a287e230 Mon Sep 17 00:00:00 2001 From: Whorra <50307674+Whorra@users.noreply.github.com> Date: Wed, 6 Jul 2022 13:09:40 +0800 Subject: [PATCH] Fix range in clearExtraData (#278) * Fix range in clearExtraData --- kv/raftstore/peer_storage.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kv/raftstore/peer_storage.go b/kv/raftstore/peer_storage.go index 06c2a3974..ad40fd464 100644 --- a/kv/raftstore/peer_storage.go +++ b/kv/raftstore/peer_storage.go @@ -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) } }