Browse Source

fix(shell): set LastLocalSyncTsNs in remote.copy.local so remote.uncache works (#8604)

remote.uncache checks LastLocalSyncTsNs to determine if a file has been
synced to remote. remote.copy.local was not setting this field, leaving
it at 0, which caused uncache to skip all files uploaded via
remote.copy.local.

Fixes #8602
pull/8605/head
Chris Lu 5 days ago
committed by GitHub
parent
commit
b799650357
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      weed/shell/command_remote_copy_local.go

2
weed/shell/command_remote_copy_local.go

@ -8,6 +8,7 @@ import (
"strings" "strings"
"sync" "sync"
"sync/atomic" "sync/atomic"
"time"
"github.com/seaweedfs/seaweedfs/weed/filer" "github.com/seaweedfs/seaweedfs/weed/filer"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb" "github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@ -253,6 +254,7 @@ func syncFileToRemote(commandEnv *CommandEnv, remoteStorage remote_storage.Remot
ctx := context.Background() ctx := context.Background()
// Update local entry with remote information // Update local entry with remote information
remoteEntry.LastLocalSyncTsNs = time.Now().UnixNano()
localEntry.RemoteEntry = remoteEntry localEntry.RemoteEntry = remoteEntry
// Update the entry // Update the entry

Loading…
Cancel
Save