Skip to content

Commit 7f03775

Browse files
committed
db: don't configure WAL failover if ReadOnly
In ReadOnly mode, don't bother to set up the WAL failover manager if not in ReadOnly mode. In ReadOnly mode we'll never create a WAL, so there's no need to set up the failover manager. The failover manager writes a secondary identifier file during initialization.
1 parent b6f94f3 commit 7f03775

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

open.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ func Open(dirname string, opts *Options) (db *DB, err error) {
351351
return nil, err
352352
}
353353
}
354-
if opts.WALFailover != nil {
354+
if !opts.ReadOnly && opts.WALFailover != nil {
355355
walOpts.Secondary = opts.WALFailover.Secondary
356356
// Lock the secondary WAL directory, if distinct from the data directory
357357
// and primary WAL directory.

0 commit comments

Comments
 (0)