diff options
| author | chrislu <chris.lu@gmail.com> | 2022-08-01 00:06:18 -0700 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2022-08-01 00:06:18 -0700 |
| commit | 036566629ac327deaa66a296387901b56b6fb325 (patch) | |
| tree | 1148ff854caf475434a7dd34fce550374dc31f27 /weed/filer/filechunks.go | |
| parent | 303bd067b568dc4834753fe54b17365757ef5406 (diff) | |
| download | seaweedfs-036566629ac327deaa66a296387901b56b6fb325.tar.xz seaweedfs-036566629ac327deaa66a296387901b56b6fb325.zip | |
filer.sync: fix synchronization logic in active-active mode
fix https://github.com/seaweedfs/seaweedfs/issues/3328
Diffstat (limited to 'weed/filer/filechunks.go')
| -rw-r--r-- | weed/filer/filechunks.go | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/filer/filechunks.go b/weed/filer/filechunks.go index 3b99e0785..00f4c2921 100644 --- a/weed/filer/filechunks.go +++ b/weed/filer/filechunks.go @@ -114,9 +114,12 @@ func DoMinusChunksBySourceFileId(as, bs []*filer_pb.FileChunk) (delta []*filer_p fileIds := make(map[string]bool) for _, interval := range bs { fileIds[interval.GetFileIdString()] = true + fileIds[interval.GetSourceFileId()] = true } for _, chunk := range as { - if _, found := fileIds[chunk.GetSourceFileId()]; !found { + _, sourceFileIdFound := fileIds[chunk.GetSourceFileId()] + _, fileIdFound := fileIds[chunk.GetFileId()] + if !sourceFileIdFound && !fileIdFound { delta = append(delta, chunk) } } |
