diff --git a/config.example.yml b/config.example.yml index 59d1a06d6..b8abaa8d6 100644 --- a/config.example.yml +++ b/config.example.yml @@ -52,6 +52,7 @@ database: # Enforce Galera cluster nodes to perform strict cluster-wide causality checks before executing # specific SQL queries determined by the number you provided. + # Note: You can only set this option to a number "0 - 15". # Defaults to 7. # See https://icinga.com/docs/icinga-db/latest/doc/03-Configuration/#galera-cluster # wsrep_sync_wait: 7 diff --git a/pkg/icingadb/db.go b/pkg/icingadb/db.go index 88214d979..1bff6a6c4 100644 --- a/pkg/icingadb/db.go +++ b/pkg/icingadb/db.go @@ -75,6 +75,9 @@ func (o *Options) Validate() error { if o.MaxRowsPerTransaction < 1 { return errors.New("max_rows_per_transaction must be at least 1") } + if o.WsrepSyncWait < 0 || o.WsrepSyncWait > 15 { + return errors.New("wsrep_sync_wait can only be set to a number between 0 and 15") + } return nil }