Skip to content

Commit

Permalink
engine: don't create aux dir for read-only engine
Browse files Browse the repository at this point in the history
It was mildly irritating that

    ./cockroach debug raft-log not/there 1

would create `not/there/auxiliary`.

Release note: None
  • Loading branch information
tbg committed Oct 29, 2019
1 parent 2274786 commit 5ef4362
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions pkg/storage/engine/rocksdb.go
Original file line number Diff line number Diff line change
Expand Up @@ -3059,8 +3059,10 @@ func (r *RocksDB) GetAuxiliaryDir() string {
}

func (r *RocksDB) setAuxiliaryDir(d string) error {
if err := os.MkdirAll(d, 0755); err != nil {
return err
if !r.cfg.ReadOnly {
if err := os.MkdirAll(d, 0755); err != nil {
return err
}
}
r.auxDir = d
return nil
Expand Down

0 comments on commit 5ef4362

Please sign in to comment.