kahing / goofys

a high-performance, POSIX-ish Amazon S3 file system written in Go
Apache License 2.0
5.19k stars 521 forks source link

Is cache remained if using goofys as multi mount in shell scripts ? #279

Open Dlllly opened 6 years ago

Dlllly commented 6 years ago

I use goofys in multi mount like one s3 bucket and two servers using goofys. I think in multi mount environment, goofys can not operate correctly. For example, look at the below scripts and commands. In this case, goofys can not delete cache, and still maintain cache. However, when I execute same script in command lines, goofys delete cache correctly. In short, this problem is occurred only in using shell scripts.

So, let me know how I can use goofys correctly. Is this my mistake in goofys settings?

Thank you.

Server Unit 1

$ ./lsTest.sh
testFile
testFile ←This file should be already deleted because this cache should be expired.
#!/bin/bash
goofys -o allow_other -uid 0 -gid 0 --dir-mode=077 --file-mode=0777 --type-cache-ttl 10s --stat-cache-ttl 10s --cheap /mnt/goofys 
ls /mnt/goofys/dir
touch /mnt/goofys/dir/testFile
ls /mnt/goofys/dir/tesrfile
sleep 15
ls /mnt/goofys/dir

Server Unit 2 (This is executed when Server Unit 1 execute sleep commnd.)

$ rm /mnt/goofys/dir/testfile
kahing commented 6 years ago

you are not using --cache so this is mostly just the linux vfs cache and inode caching within goofys. In that case yes you cannot expect goofys to know that you've deleted the file from another server/mountpoint. goofys is not a perfect replacement for NFS.

kahing commented 6 years ago

Hmm I didn't notice the 10s ttl in the command line. I am currently traveling so won't be able to look at this for another week or so.

Dllly commented 6 years ago

Thank you for your reply. Ok, enjoy your traveling.