Skip to content

Commit

Permalink
simulator: fix region size and keys (tikv#8366)
Browse files Browse the repository at this point in the history
ref tikv#8135

Signed-off-by: lhy1024 <[email protected]>
  • Loading branch information
lhy1024 authored Jul 5, 2024
1 parent bc28a0f commit aecb4ab
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/pd-simulator/simulator/raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,17 +61,16 @@ func NewRaftEngine(conf *cases.Case, conn *Connection, storeConfig *config.SimCo
if i < len(conf.Regions)-1 {
meta.EndKey = []byte(splitKeys[i])
}
regionSize := storeConfig.Coprocessor.RegionSplitSize
regionInfo := core.NewRegionInfo(
meta,
region.Leader,
core.SetApproximateSize(int64(regionSize)),
core.SetApproximateKeys(int64(storeConfig.Coprocessor.RegionSplitKey)),
core.SetApproximateSize(region.Size),
core.SetApproximateKeys(region.Keys),
)
r.SetRegion(regionInfo)
peers := region.Peers
for _, peer := range peers {
r.conn.Nodes[peer.StoreId].incUsedSize(uint64(regionSize))
r.conn.Nodes[peer.StoreId].incUsedSize(uint64(region.Size))
}
}

Expand Down

0 comments on commit aecb4ab

Please sign in to comment.