From e1302a1bb11bdef4d6bb5b5cd7f86f28e69ac97d Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 5 Apr 2023 01:07:23 +0300 Subject: [PATCH] Log conflicts with inode ID --- internal/file.go | 12 ++++++------ internal/handles.go | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/internal/file.go b/internal/file.go index 50213b45..8160237b 100644 --- a/internal/file.go +++ b/internal/file.go @@ -1336,7 +1336,7 @@ func (inode *Inode) SendUpload() bool { err = nil notFoundIgnore = true } else if mappedErr == fuse.ENOENT || mappedErr == syscall.ERANGE { - s3Log.Warnf("Conflict detected: failed to copy %v to %v: %v. File is removed remotely, dropping cache", from, key, err) + s3Log.Warnf("Conflict detected (inode %v): failed to copy %v to %v: %v. File is removed remotely, dropping cache", inode.Id, from, key, err) inode.mu.Lock() newParent := inode.Parent oldParent := inode.oldParent @@ -1482,7 +1482,7 @@ func (inode *Inode) SendUpload() bool { inode.userMetadataDirty = 2 if mappedErr == fuse.ENOENT || mappedErr == syscall.ERANGE { // Object is deleted or resized remotely (416). Discard local version - log.Warnf("Conflict detected: File %v is deleted or resized remotely, discarding local changes", inode.FullName()) + s3Log.Warnf("Conflict detected (inode %v): File %v is deleted or resized remotely, discarding local changes", inode.Id, inode.FullName()) inode.resetCache() } log.Errorf("Error flushing metadata using COPY for %v: %v", key, err) @@ -1726,7 +1726,7 @@ func (inode *Inode) FlushSmallObject() { mappedErr := mapAwsError(err) if mappedErr == fuse.ENOENT || mappedErr == syscall.ERANGE { // Object is deleted or resized remotely (416). Discard local version - log.Warnf("Conflict detected: File %v is deleted or resized remotely, discarding local changes", inode.FullName()) + s3Log.Warnf("Conflict detected (inode %v): File %v is deleted or resized remotely, discarding local changes", inode.Id, inode.FullName()) inode.resetCache() inode.IsFlushing -= inode.fs.flags.MaxParallelParts atomic.AddInt64(&inode.fs.activeFlushers, -1) @@ -1780,7 +1780,7 @@ func (inode *Inode) FlushSmallObject() { inode.userMetadataDirty = 2 } } else { - log.Debugf("Flushed small file %v: etag=%v, size=%v", key, NilStr(resp.ETag), sz) + log.Debugf("Flushed small file %v (inode %v): etag=%v, size=%v", key, inode.Id, NilStr(resp.ETag), sz) stillDirty := inode.userMetadataDirty != 0 || inode.oldParent != nil for i := 0; i < len(inode.buffers); i++ { b := inode.buffers[i] @@ -1924,7 +1924,7 @@ func (inode *Inode) FlushPart(part uint64) { mappedErr := mapAwsError(err) if mappedErr == fuse.ENOENT || mappedErr == syscall.ERANGE { // Object is deleted or resized remotely (416). Discard local version - log.Warnf("Conflict detected: File %v is deleted or resized remotely, discarding local changes", inode.FullName()) + s3Log.Warnf("Conflict detected (inode %v): File %v is deleted or resized remotely, discarding local changes", inode.Id, inode.FullName()) inode.resetCache() return } @@ -2008,7 +2008,7 @@ func (inode *Inode) completeMultipart() { mappedErr := mapAwsError(err) if mappedErr == fuse.ENOENT || mappedErr == syscall.ERANGE { // Object is deleted or resized remotely (416). Discard local version - log.Warnf("Conflict detected: File %v is deleted or resized remotely, discarding local changes", inode.FullName()) + s3Log.Warnf("Conflict detected (inode %v): File %v is deleted or resized remotely, discarding local changes", inode.Id, inode.FullName()) inode.resetCache() return } diff --git a/internal/handles.go b/internal/handles.go index 608b793c..7897fa7c 100644 --- a/internal/handles.go +++ b/internal/handles.go @@ -204,9 +204,9 @@ func (inode *Inode) SetFromBlobItem(item *BlobItemOutput) { // Otherwise we may not be able to make a correct object version if item.ETag != nil && inode.knownETag != *item.ETag || item.Size != inode.knownSize { if inode.CacheState != ST_CACHED && (inode.knownETag != "" || inode.knownSize > 0) { - s3Log.Warnf("Conflict detected: server-side ETag or size of %v"+ + s3Log.Warnf("Conflict detected (inode %v): server-side ETag or size of %v"+ " (%v, %v) differs from local (%v, %v). File is changed remotely, dropping cache", - inode.FullName(), NilStr(item.ETag), item.Size, inode.knownETag, inode.knownSize) + inode.Id, inode.FullName(), NilStr(item.ETag), item.Size, inode.knownETag, inode.knownSize) } inode.resetCache() inode.ResizeUnlocked(item.Size, false, false)