aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2019-06-20 23:45:30 -0700
committerChris Lu <chris.lu@gmail.com>2019-06-20 23:45:30 -0700
commit11be0b5e91180246edf48e0b49f6203cecdca397 (patch)
tree0fae90bbea0c10c9f414f5a6f49cac07d71313aa
parent4b0f084b5db4637817ef7980d3329eef3e4dba02 (diff)
downloadseaweedfs-11be0b5e91180246edf48e0b49f6203cecdca397.tar.xz
seaweedfs-11be0b5e91180246edf48e0b49f6203cecdca397.zip
more logging
-rw-r--r--weed/filer2/filer.go5
-rw-r--r--weed/filesys/filehandle.go5
2 files changed, 10 insertions, 0 deletions
diff --git a/weed/filer2/filer.go b/weed/filer2/filer.go
index 68ca3180f..cf236b74d 100644
--- a/weed/filer2/filer.go
+++ b/weed/filer2/filer.go
@@ -153,10 +153,12 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry) error {
if oldEntry == nil {
if err := f.store.InsertEntry(ctx, entry); err != nil {
+ glog.Errorf("insert entry %s: %v", entry.FullPath, err)
return fmt.Errorf("insert entry %s: %v", entry.FullPath, err)
}
} else {
if err := f.UpdateEntry(ctx, oldEntry, entry); err != nil {
+ glog.Errorf("update entry %s: %v", entry.FullPath, err)
return fmt.Errorf("update entry %s: %v", entry.FullPath, err)
}
}
@@ -171,9 +173,11 @@ func (f *Filer) CreateEntry(ctx context.Context, entry *Entry) error {
func (f *Filer) UpdateEntry(ctx context.Context, oldEntry, entry *Entry) (err error) {
if oldEntry != nil {
if oldEntry.IsDirectory() && !entry.IsDirectory() {
+ glog.Errorf("existing %s is a directory", entry.FullPath)
return fmt.Errorf("existing %s is a directory", entry.FullPath)
}
if !oldEntry.IsDirectory() && entry.IsDirectory() {
+ glog.Errorf("existing %s is a file", entry.FullPath)
return fmt.Errorf("existing %s is a file", entry.FullPath)
}
}
@@ -215,6 +219,7 @@ func (f *Filer) DeleteEntryMetaAndData(ctx context.Context, p FullPath, isRecurs
for limit > 0 {
entries, err := f.ListDirectoryEntries(ctx, p, lastFileName, includeLastFile, 1024)
if err != nil {
+ glog.Errorf("list folder %s: %v", p, err)
return fmt.Errorf("list folder %s: %v", p, err)
}
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index 577403cef..789675486 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -68,6 +68,10 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
resp.Data = buff[:totalRead]
+ if err != nil {
+ glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err)
+ }
+
return err
}
@@ -162,6 +166,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error {
// fh.f.entryViewCache = nil
if _, err := client.CreateEntry(ctx, request); err != nil {
+ glog.Errorf("update fh: %v", err)
return fmt.Errorf("update fh: %v", err)
}