mirror of
https://github.com/etcd-io/bbolt.git
synced 2025-05-01 21:19:39 +00:00
When the database has a lot of freepages, the cost to sync all freepages down to disk is high. If the total database size is small (<10GB), and the application can tolerate ~10 seconds recovery time, then it is reasonable to simply not sync freelist and rescan the db to rebuild freelist on recovery.
48 lines
1.7 KiB
Go
48 lines
1.7 KiB
Go
package bolt_test
|
|
|
|
import (
|
|
"testing"
|
|
|
|
"github.com/coreos/bbolt"
|
|
)
|
|
|
|
func TestSimulateNoFreeListSync_1op_1p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 1, 1)
|
|
}
|
|
func TestSimulateNoFreeListSync_10op_1p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10, 1)
|
|
}
|
|
func TestSimulateNoFreeListSync_100op_1p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 100, 1)
|
|
}
|
|
func TestSimulateNoFreeListSync_1000op_1p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 1000, 1)
|
|
}
|
|
func TestSimulateNoFreeListSync_10000op_1p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10000, 1)
|
|
}
|
|
func TestSimulateNoFreeListSync_10op_10p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10, 10)
|
|
}
|
|
func TestSimulateNoFreeListSync_100op_10p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 100, 10)
|
|
}
|
|
func TestSimulateNoFreeListSync_1000op_10p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 1000, 10)
|
|
}
|
|
func TestSimulateNoFreeListSync_10000op_10p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10000, 10)
|
|
}
|
|
func TestSimulateNoFreeListSync_100op_100p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 100, 100)
|
|
}
|
|
func TestSimulateNoFreeListSync_1000op_100p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 1000, 100)
|
|
}
|
|
func TestSimulateNoFreeListSync_10000op_100p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10000, 100)
|
|
}
|
|
func TestSimulateNoFreeListSync_10000op_1000p(t *testing.T) {
|
|
testSimulate(t, &bolt.Options{NoFreelistSync: true}, 8, 10000, 1000)
|
|
}
|