From 3c3682fcce4649089dc0425e82c2df613dd200c3 Mon Sep 17 00:00:00 2001 From: Konstantin Lebedev <9497591+kmlebedev@users.noreply.github.com> Date: Tue, 6 Sep 2022 20:19:13 +0500 Subject: [PATCH] more log detail for upload err and deleting (#3577) --- weed/filer/filer_deletion.go | 2 +- weed/server/volume_server_handlers_write.go | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/weed/filer/filer_deletion.go b/weed/filer/filer_deletion.go index 0c354f889..f6279740c 100644 --- a/weed/filer/filer_deletion.go +++ b/weed/filer/filer_deletion.go @@ -58,7 +58,7 @@ func (f *Filer) loopProcessingDeletion() { glog.V(0).Infof("deleting fileIds len=%d error: %v", deletionCount, err) } } else { - glog.V(2).Infof("deleting fileIds len=%d", deletionCount) + glog.V(2).Infof("deleting fileIds %+v", toDeleteFileIds) } } }) diff --git a/weed/server/volume_server_handlers_write.go b/weed/server/volume_server_handlers_write.go index 009980f56..ce639c43c 100644 --- a/weed/server/volume_server_handlers_write.go +++ b/weed/server/volume_server_handlers_write.go @@ -46,6 +46,9 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { ret := operation.UploadResult{} isUnchanged, writeError := topology.ReplicatedWrite(vs.GetMaster, vs.grpcDialOption, vs.store, volumeId, reqNeedle, r) + if writeError != nil { + writeJsonError(w, r, http.StatusInternalServerError, writeError) + } // http 204 status code does not allow body if writeError == nil && isUnchanged { @@ -55,10 +58,6 @@ func (vs *VolumeServer) PostHandler(w http.ResponseWriter, r *http.Request) { } httpStatus := http.StatusCreated - if writeError != nil { - httpStatus = http.StatusInternalServerError - ret.Error = writeError.Error() - } if reqNeedle.HasName() { ret.Name = string(reqNeedle.Name) }