From 211171e6695b492021375e6e8af3cb7e1337a65c Mon Sep 17 00:00:00 2001 From: zuzuviewer <750938164@qq.com> Date: Thu, 21 Mar 2024 23:43:54 +0800 Subject: [PATCH 1/3] Fix iam service response 500 (#5405) --- weed/iamapi/iamapi_management_handlers.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/iamapi/iamapi_management_handlers.go b/weed/iamapi/iamapi_management_handlers.go index be9e4f874..d63bc8849 100644 --- a/weed/iamapi/iamapi_management_handlers.go +++ b/weed/iamapi/iamapi_management_handlers.go @@ -3,6 +3,7 @@ package iamapi import ( "crypto/sha1" "encoding/json" + "errors" "fmt" "math/rand" "net/http" @@ -13,6 +14,7 @@ import ( "time" "github.com/seaweedfs/seaweedfs/weed/glog" + "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/pb/iam_pb" "github.com/seaweedfs/seaweedfs/weed/s3api/s3_constants" "github.com/seaweedfs/seaweedfs/weed/s3api/s3err" @@ -424,7 +426,7 @@ func (iama *IamApiServer) DoActions(w http.ResponseWriter, r *http.Request) { } values := r.PostForm s3cfg := &iam_pb.S3ApiConfiguration{} - if err := iama.s3ApiConfig.GetS3ApiConfiguration(s3cfg); err != nil { + if err := iama.s3ApiConfig.GetS3ApiConfiguration(s3cfg); err != nil && !errors.Is(err, filer_pb.ErrNotFound) { s3err.WriteErrorResponse(w, r, s3err.ErrInternalError) return } From 407a52fc93125be85c23ef80eb73ae03c95b49ad Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 21 Mar 2024 23:23:26 -0700 Subject: [PATCH 2/3] adjust log level --- weed/util/log_buffer/log_read.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 29ac88b18..2a0b9743b 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -125,7 +125,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition } - glog.V(0).Infof("%s sent messages ts[%+v,%+v] size %d\n", readerName, startPosition, lastReadPosition, batchSize) + glog.V(4).Infof("%s sent messages ts[%+v,%+v] size %d\n", readerName, startPosition, lastReadPosition, batchSize) } } From 5c0fcae039f856aa4bbc4b21ffc0910b20254444 Mon Sep 17 00:00:00 2001 From: chrislu Date: Thu, 21 Mar 2024 23:24:18 -0700 Subject: [PATCH 3/3] clean up logs --- weed/util/log_buffer/log_read.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 2a0b9743b..c3dd0f288 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -40,7 +40,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition if bytesBuf != nil { logBuffer.ReleaseMemory(bytesBuf) } - println("LoopProcessLogData", readerName, "sent messages total", entryCounter) + // println("LoopProcessLogData", readerName, "sent messages total", entryCounter) }() for { @@ -105,7 +105,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition } if stopTsNs != 0 && logEntry.TsNs > stopTsNs { isDone = true - println("stopTsNs", stopTsNs, "logEntry.TsNs", logEntry.TsNs) + // println("stopTsNs", stopTsNs, "logEntry.TsNs", logEntry.TsNs) return } lastReadPosition = NewMessagePosition(logEntry.TsNs, batchIndex)