mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-11-24 11:09:12 +08:00
Merge pull request #3216 from kmlebedev/mk_raft_basedir
avoid no such raft date directory
This commit is contained in:
commit
d652ce1a36
@ -121,7 +121,10 @@ func NewHashicorpRaftServer(option *RaftServerOption) (*RaftServer, error) {
|
||||
if option.RaftBootstrap {
|
||||
os.RemoveAll(path.Join(s.dataDir, ldbFile))
|
||||
os.RemoveAll(path.Join(s.dataDir, sdbFile))
|
||||
os.RemoveAll(path.Join(s.dataDir, "snapshot"))
|
||||
os.RemoveAll(path.Join(s.dataDir, "snapshots"))
|
||||
}
|
||||
if err := os.MkdirAll(path.Join(s.dataDir, "snapshots"), os.ModePerm); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
baseDir := s.dataDir
|
||||
|
||||
|
@ -125,7 +125,7 @@ func NewRaftServer(option *RaftServerOption) (*RaftServer, error) {
|
||||
os.RemoveAll(path.Join(s.dataDir, "conf"))
|
||||
os.RemoveAll(path.Join(s.dataDir, "snapshot"))
|
||||
}
|
||||
if err := os.MkdirAll(path.Join(s.dataDir, "snapshot"), 0700); err != nil {
|
||||
if err := os.MkdirAll(path.Join(s.dataDir, "snapshot"), os.ModePerm); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user