From ac22f1dd2656a88fbeb228fa05993ea20b20be09 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Mon, 7 Dec 2020 00:10:49 -0800 Subject: [PATCH] filer subscribe: handle rename subscription --- weed/server/filer_grpc_server_sub_meta.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/weed/server/filer_grpc_server_sub_meta.go b/weed/server/filer_grpc_server_sub_meta.go index 634fb5211..3b8ced675 100644 --- a/weed/server/filer_grpc_server_sub_meta.go +++ b/weed/server/filer_grpc_server_sub_meta.go @@ -153,7 +153,14 @@ func (fs *FilerServer) eachEventNotificationFn(req *filer_pb.SubscribeMetadataRe } if !strings.HasPrefix(fullpath, req.PathPrefix) { - return nil + if eventNotification.NewParentPath != "" { + newFullPath := util.Join(eventNotification.NewParentPath, entryName) + if !strings.HasPrefix(newFullPath, req.PathPrefix) { + return nil + } + } else { + return nil + } } message := &filer_pb.SubscribeMetadataResponse{