diff options
| author | chrislu <chris.lu@gmail.com> | 2024-03-21 08:22:14 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-03-21 08:22:14 -0700 |
| commit | e641d49f9f995b5648303e8d005d401e7c75c6d2 (patch) | |
| tree | f9efb0b0fb61c4f130736d5b4ae085bdee4001c0 | |
| parent | 7003ce7425d81684bc02585a8dd4cef79153115c (diff) | |
| parent | 25643cfbc6fdde5a73725b557fd2d6ae8e66484f (diff) | |
| download | seaweedfs-e641d49f9f995b5648303e8d005d401e7c75c6d2.tar.xz seaweedfs-e641d49f9f995b5648303e8d005d401e7c75c6d2.zip | |
Merge branch 'master' into mq-subscribe
| -rw-r--r-- | weed/command/filer_sync.go | 2 | ||||
| -rw-r--r-- | weed/replication/sink/s3sink/s3_sink.go | 19 | ||||
| -rw-r--r-- | weed/util/log_buffer/log_read.go | 2 |
3 files changed, 14 insertions, 9 deletions
diff --git a/weed/command/filer_sync.go b/weed/command/filer_sync.go index 292fb0956..9ad76e31b 100644 --- a/weed/command/filer_sync.go +++ b/weed/command/filer_sync.go @@ -394,7 +394,7 @@ func genProcessFunction(sourcePath string, targetPath string, excludePaths []str glog.V(0).Infof("received %v", resp) } - if isMultipartUploadDir(resp.Directory) { + if isMultipartUploadDir(resp.Directory + "/") { return nil } diff --git a/weed/replication/sink/s3sink/s3_sink.go b/weed/replication/sink/s3sink/s3_sink.go index 276ea30d6..81acd9a2d 100644 --- a/weed/replication/sink/s3sink/s3_sink.go +++ b/weed/replication/sink/s3sink/s3_sink.go @@ -175,18 +175,23 @@ func (s3sink *S3Sink) CreateEntry(key string, entry *filer_pb.Entry, signatures uploader.PartSize = 0 } } - if _, ok := entry.Extended[s3_constants.AmzUserMetaMtime]; !ok { + + doSaveMtime := true + if entry.Extended == nil { + entry.Extended = make(map[string][]byte) + } else if _, ok := entry.Extended[s3_constants.AmzUserMetaMtime]; ok { + doSaveMtime = false + } + if doSaveMtime { entry.Extended[s3_constants.AmzUserMetaMtime] = []byte(strconv.FormatInt(entry.Attributes.Mtime, 10)) } // process tagging tags := "" - if true { - for k, v := range entry.Extended { - if len(tags) > 0 { - tags = tags + "&" - } - tags = tags + k + "=" + string(v) + for k, v := range entry.Extended { + if len(tags) > 0 { + tags = tags + "&" } + tags = tags + k + "=" + string(v) } // Upload the file to S3. diff --git a/weed/util/log_buffer/log_read.go b/weed/util/log_buffer/log_read.go index 866805c47..29ac88b18 100644 --- a/weed/util/log_buffer/log_read.go +++ b/weed/util/log_buffer/log_read.go @@ -57,7 +57,7 @@ func (logBuffer *LogBuffer) LoopProcessLogData(readerName string, startPosition if bytesBuf != nil { readSize = bytesBuf.Len() } - glog.V(1).Infof("%s ReadFromBuffer at %v batch %d. Read bytes %v batch %d", readerName, lastReadPosition, lastReadPosition.BatchIndex, readSize, batchIndex) + glog.V(4).Infof("%s ReadFromBuffer at %v batch %d. Read bytes %v batch %d", readerName, lastReadPosition, lastReadPosition.BatchIndex, readSize, batchIndex) if bytesBuf == nil { if batchIndex >= 0 { lastReadPosition = NewMessagePosition(lastReadPosition.UnixNano(), batchIndex) |
