mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
add printouts for synchronizing metadata which can be slow for large folders
This commit is contained in:
parent
0c856e8387
commit
ac48c899e8
|
@ -141,26 +141,13 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||||
options = append(options, fuse.AllowNonEmptyMount())
|
options = append(options, fuse.AllowNonEmptyMount())
|
||||||
}
|
}
|
||||||
|
|
||||||
// mount
|
|
||||||
c, err := fuse.Mount(dir, options...)
|
|
||||||
if err != nil {
|
|
||||||
glog.V(0).Infof("mount: %v", err)
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
defer fuse.Unmount(dir)
|
|
||||||
|
|
||||||
grace.OnInterrupt(func() {
|
|
||||||
fuse.Unmount(dir)
|
|
||||||
c.Close()
|
|
||||||
})
|
|
||||||
|
|
||||||
// find mount point
|
// find mount point
|
||||||
mountRoot := filerMountRootPath
|
mountRoot := filerMountRootPath
|
||||||
if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") {
|
if mountRoot != "/" && strings.HasSuffix(mountRoot, "/") {
|
||||||
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
mountRoot = mountRoot[0 : len(mountRoot)-1]
|
||||||
}
|
}
|
||||||
|
|
||||||
err = fs.Serve(c, filesys.NewSeaweedFileSystem(&filesys.Option{
|
seaweedFileSystem := filesys.NewSeaweedFileSystem(&filesys.Option{
|
||||||
FilerGrpcAddress: filerGrpcAddress,
|
FilerGrpcAddress: filerGrpcAddress,
|
||||||
GrpcDialOption: grpcDialOption,
|
GrpcDialOption: grpcDialOption,
|
||||||
FilerMountRootPath: mountRoot,
|
FilerMountRootPath: mountRoot,
|
||||||
|
@ -182,7 +169,23 @@ func RunMount(option *MountOptions, umask os.FileMode) bool {
|
||||||
OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode,
|
OutsideContainerClusterMode: *mountOptions.outsideContainerClusterMode,
|
||||||
AsyncMetaDataCaching: *mountOptions.asyncMetaDataCaching,
|
AsyncMetaDataCaching: *mountOptions.asyncMetaDataCaching,
|
||||||
Cipher: cipher,
|
Cipher: cipher,
|
||||||
}))
|
})
|
||||||
|
|
||||||
|
// mount
|
||||||
|
c, err := fuse.Mount(dir, options...)
|
||||||
|
if err != nil {
|
||||||
|
glog.V(0).Infof("mount: %v", err)
|
||||||
|
return true
|
||||||
|
}
|
||||||
|
defer fuse.Unmount(dir)
|
||||||
|
|
||||||
|
grace.OnInterrupt(func() {
|
||||||
|
fuse.Unmount(dir)
|
||||||
|
c.Close()
|
||||||
|
})
|
||||||
|
|
||||||
|
glog.V(0).Infof("mounted %s%s to %s", filer, mountRoot, dir)
|
||||||
|
err = fs.Serve(c, seaweedFileSystem)
|
||||||
|
|
||||||
// check if the mount process has an error to report
|
// check if the mount process has an error to report
|
||||||
<-c.Ready
|
<-c.Ready
|
||||||
|
|
|
@ -10,6 +10,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func InitMetaCache(mc *MetaCache, client filer_pb.FilerClient, path string) error {
|
func InitMetaCache(mc *MetaCache, client filer_pb.FilerClient, path string) error {
|
||||||
|
glog.V(0).Infof("synchronizing meta data ...")
|
||||||
filer_pb.TraverseBfs(client, util.FullPath(path), func(parentPath util.FullPath, pbEntry *filer_pb.Entry) {
|
filer_pb.TraverseBfs(client, util.FullPath(path), func(parentPath util.FullPath, pbEntry *filer_pb.Entry) {
|
||||||
entry := filer2.FromPbEntry(string(parentPath), pbEntry)
|
entry := filer2.FromPbEntry(string(parentPath), pbEntry)
|
||||||
if err := mc.InsertEntry(context.Background(), entry); err != nil {
|
if err := mc.InsertEntry(context.Background(), entry); err != nil {
|
||||||
|
|
Loading…
Reference in a new issue