File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -1418,6 +1418,13 @@ type WALFailoverOptions struct {
14181418 wal.FailoverOptions
14191419}
14201420
1421+ func (o * WALFailoverOptions ) Validate () error {
1422+ if o .Secondary .FS == nil {
1423+ return errors .New ("Secondary.FS is required" )
1424+ }
1425+ return nil
1426+ }
1427+
14211428// ReadaheadConfig controls the use of read-ahead.
14221429type ReadaheadConfig = objstorageprovider.ReadaheadConfig
14231430
@@ -2592,6 +2599,12 @@ func (o *Options) Validate() error {
25922599 }
25932600 }
25942601
2602+ if o .WALFailover != nil {
2603+ if err := o .WALFailover .Validate (); err != nil {
2604+ fmt .Fprintf (& buf , "WALFailover validation failed: %v\n " , err )
2605+ }
2606+ }
2607+
25952608 if buf .Len () == 0 {
25962609 return nil
25972610 }
Original file line number Diff line number Diff line change @@ -547,6 +547,14 @@ func TestOptionsValidate(t *testing.T) {
547547 }
548548 })
549549 }
550+ t .Run ("wal-failover" , func (t * testing.T ) {
551+ var opts Options
552+ opts .EnsureDefaults ()
553+ opts .WALFailover = & WALFailoverOptions {}
554+ err := opts .Validate ()
555+ require .Error (t , err )
556+ require .Regexp (t , "Secondary.FS is required" , err .Error ())
557+ })
550558}
551559
552560func TestKeyCategories (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments