diff options
| -rw-r--r-- | weed/storage/backend/s3_backend/s3_backend.go | 15 | ||||
| -rw-r--r-- | weed/storage/store.go | 2 | ||||
| -rw-r--r-- | weed/storage/volume.go | 2 |
3 files changed, 10 insertions, 9 deletions
diff --git a/weed/storage/backend/s3_backend/s3_backend.go b/weed/storage/backend/s3_backend/s3_backend.go index 01fcc1283..0b3db3c67 100644 --- a/weed/storage/backend/s3_backend/s3_backend.go +++ b/weed/storage/backend/s3_backend/s3_backend.go @@ -124,8 +124,6 @@ func (s3backendStorageFile S3BackendStorageFile) ReadAt(p []byte, off int64) (n bytesRange := fmt.Sprintf("bytes=%d-%d", off, off+int64(len(p))-1) - // glog.V(0).Infof("read %s %s", s3backendStorageFile.key, bytesRange) - getObjectOutput, getObjectErr := s3backendStorageFile.backendStorage.conn.GetObject(&s3.GetObjectInput{ Bucket: &s3backendStorageFile.backendStorage.bucket, Key: &s3backendStorageFile.key, @@ -137,13 +135,16 @@ func (s3backendStorageFile S3BackendStorageFile) ReadAt(p []byte, off int64) (n } defer getObjectOutput.Body.Close() - glog.V(4).Infof("read %s %s", s3backendStorageFile.key, bytesRange) - glog.V(4).Infof("content range: %s, contentLength: %d", *getObjectOutput.ContentRange, *getObjectOutput.ContentLength) + // glog.V(3).Infof("read %s %s", s3backendStorageFile.key, bytesRange) + // glog.V(3).Infof("content range: %s, contentLength: %d", *getObjectOutput.ContentRange, *getObjectOutput.ContentLength) + var readCount int for { - if n, err = getObjectOutput.Body.Read(p); err == nil && n < len(p) { - p = p[n:] - } else { + p = p[readCount:] + readCount, err = getObjectOutput.Body.Read(p) + n += readCount + + if err != nil { break } } diff --git a/weed/storage/store.go b/weed/storage/store.go index 3cb35cb85..e12fb2c50 100644 --- a/weed/storage/store.go +++ b/weed/storage/store.go @@ -549,7 +549,7 @@ func (s *Store) MaybeAdjustVolumeMax() (hasChanges bool) { maxVolumeCount += int32(uint64(unclaimedSpaces)/volumeSizeLimit) - 1 } atomic.StoreInt32(&diskLocation.MaxVolumeCount, maxVolumeCount) - glog.V(2).Infof("disk %s max %d unclaimedSpace:%dMB, unused:%dMB volumeSizeLimit:%dMB", + glog.V(4).Infof("disk %s max %d unclaimedSpace:%dMB, unused:%dMB volumeSizeLimit:%dMB", diskLocation.Directory, maxVolumeCount, unclaimedSpaces/1024/1024, unusedSpace/1024/1024, volumeSizeLimit/1024/1024) hasChanges = hasChanges || currentMaxVolumeCount != atomic.LoadInt32(&diskLocation.MaxVolumeCount) } diff --git a/weed/storage/volume.go b/weed/storage/volume.go index e48a2f49a..1a9c8bd24 100644 --- a/weed/storage/volume.go +++ b/weed/storage/volume.go @@ -284,7 +284,7 @@ func (v *Volume) expiredLongEnough(maxDelayMinutes uint32) bool { func (v *Volume) collectStatus() (maxFileKey types.NeedleId, datFileSize int64, modTime time.Time, fileCount, deletedCount, deletedSize uint64, ok bool) { v.dataFileAccessLock.RLock() defer v.dataFileAccessLock.RUnlock() - glog.V(3).Infof("collectStatus volume %d", v.Id) + glog.V(4).Infof("collectStatus volume %d", v.Id) if v.nm == nil || v.DataBackend == nil { return |
