mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
ignore duplicated key error if the store has duplicated primary key prevention
fix https://github.com/chrislusf/seaweedfs/issues/741
This commit is contained in:
parent
98384b62fd
commit
56a5d5af8d
|
@ -88,11 +88,13 @@ func (f *Filer) CreateEntry(entry *Entry) error {
|
||||||
glog.V(2).Infof("create directory: %s %v", dirPath, dirEntry.Mode)
|
glog.V(2).Infof("create directory: %s %v", dirPath, dirEntry.Mode)
|
||||||
mkdirErr := f.store.InsertEntry(dirEntry)
|
mkdirErr := f.store.InsertEntry(dirEntry)
|
||||||
if mkdirErr != nil {
|
if mkdirErr != nil {
|
||||||
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr)
|
if _, err := f.FindEntry(FullPath(dirPath)); err == ErrNotFound {
|
||||||
|
return fmt.Errorf("mkdir %s: %v", dirPath, mkdirErr)
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
f.NotifyUpdateEvent(nil, dirEntry, false)
|
||||||
}
|
}
|
||||||
|
|
||||||
f.NotifyUpdateEvent(nil, dirEntry, false)
|
|
||||||
|
|
||||||
} else if !dirEntry.IsDirectory() {
|
} else if !dirEntry.IsDirectory() {
|
||||||
return fmt.Errorf("%s is a file", dirPath)
|
return fmt.Errorf("%s is a file", dirPath)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue