Expose additional DB configuration settings

This commit exposes the monitor interval, checkpoint interval,
minimum checkpoint page count, and maximum checkpoint page count
via the YAML configuration file.
This commit is contained in:
Ben Johnson
2021-03-06 08:33:19 -07:00
parent 9341863bdb
commit 8947adc312
2 changed files with 25 additions and 1 deletions

5
db.go
View File

@@ -260,6 +260,11 @@ func (db *DB) PageSize() int {
// Open initializes the background monitoring goroutine.
func (db *DB) Open() (err error) {
// Validate fields on database.
if db.MinCheckpointPageN <= 0 {
return fmt.Errorf("minimum checkpoint page count required")
}
// Validate that all replica names are unique.
m := make(map[string]struct{})
for _, r := range db.Replicas {