Skip to content

Commit

Permalink
Validate wsrep_sync_wait database option
Browse files Browse the repository at this point in the history
  • Loading branch information
yhabteab committed Mar 28, 2024
1 parent 735135e commit a8075ea
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions config.example.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pkg/icingadb/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down

0 comments on commit a8075ea

Please sign in to comment.