mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-31 11:42:30 +00:00
Adjust rebalance threshold with Bucket.FillPercent
Signed-off-by: Cenk Alti <cenkalti@gmail.com>
This commit is contained in:
parent
053fd189c8
commit
03e5cc7958
4
node.go
4
node.go
@ -371,8 +371,8 @@ func (n *node) rebalance() {
|
||||
// Update statistics.
|
||||
n.bucket.tx.stats.IncRebalance(1)
|
||||
|
||||
// Ignore if node is above threshold (25%) and has enough keys.
|
||||
var threshold = n.bucket.tx.db.pageSize / 4
|
||||
// Ignore if node is above threshold (25% when FillPercent is set to DefaultFillPercent) and has enough keys.
|
||||
var threshold = int(float64(n.bucket.tx.db.pageSize)*n.bucket.FillPercent) / 2
|
||||
if n.size() > threshold && len(n.inodes) > n.minKeys() {
|
||||
return
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user