mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2025-10-21 10:37:24 +08:00
filer: support active<=>active filer replication
This commit is contained in:
12
weed/replication/sink/filersink/README.txt
Normal file
12
weed/replication/sink/filersink/README.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
How replication works
|
||||
======
|
||||
|
||||
All metadata changes within current cluster would be notified to a message queue.
|
||||
|
||||
If the meta data change is from other clusters, this metadata would change would not be notified to the message queue.
|
||||
|
||||
So active<=>active replication is possible.
|
||||
|
||||
|
||||
All metadata changes would be published as metadata changes.
|
||||
So all mounts listening for metadata changes will get updated.
|
@@ -69,7 +69,7 @@ func (fs *FilerSink) DeleteEntry(key string, isDirectory, deleteIncludeChunks bo
|
||||
dir, name := util.FullPath(key).DirAndName()
|
||||
|
||||
glog.V(1).Infof("delete entry: %v", key)
|
||||
err := filer_pb.Remove(fs, dir, name, deleteIncludeChunks, false, false)
|
||||
err := filer_pb.Remove(fs, dir, name, deleteIncludeChunks, false, false, true)
|
||||
if err != nil {
|
||||
glog.V(0).Infof("delete entry %s: %v", key, err)
|
||||
return fmt.Errorf("delete entry %s: %v", key, err)
|
||||
@@ -113,6 +113,7 @@ func (fs *FilerSink) CreateEntry(key string, entry *filer_pb.Entry) error {
|
||||
Attributes: entry.Attributes,
|
||||
Chunks: replicatedChunks,
|
||||
},
|
||||
IsFromOtherCluster: true,
|
||||
}
|
||||
|
||||
glog.V(1).Infof("create: %v", request)
|
||||
@@ -186,8 +187,9 @@ func (fs *FilerSink) UpdateEntry(key string, oldEntry *filer_pb.Entry, newParent
|
||||
return true, fs.WithFilerClient(func(client filer_pb.SeaweedFilerClient) error {
|
||||
|
||||
request := &filer_pb.UpdateEntryRequest{
|
||||
Directory: newParentPath,
|
||||
Entry: existingEntry,
|
||||
Directory: newParentPath,
|
||||
Entry: existingEntry,
|
||||
IsFromOtherCluster: true,
|
||||
}
|
||||
|
||||
if _, err := client.UpdateEntry(context.Background(), request); err != nil {
|
||||
|
Reference in New Issue
Block a user