Recheck-s3 Option is not fetching New file/directory
Opened this issue · 10 comments
In our environment, content pushes are done directly to S3 Buckets. The buckets are mounted in a readonly mode using yas3fs on ec2 instances. We have enabled local caching for the yas3fs mountpoints.
As we require the content pushes to reflect on our moutpoints on the instance, we have configured the recheck-s3 and cache-check (30 secs) options. With these configurations, the mounpoints are not reflecting the changes happening on S3 bucket. Please suggest us an appropriate configuration or workaround for this requirement.
cache-check (interval) is only used in the case of check_cache_size() to determine whether items need to be purged from the cache to free up disk space or memory. so this probably has nothing to do w/ it.
presumable you this is the equivalent of having 2 nodes (A write/ B read) setup w/o SNS/SQS communcation.
B> rm file.txt
returns success or ENOENT (depending if there was a file there or not)
B> cat file.txt
returns ENOENT
A> echo "hello world" > file.txt
A> cat file.txt
returns "hello world\n"
B> cat file.txt
I am getting consistently "hello world\n" back.
(i was checking off ewah/yas3fs's master, trying danilop/yas3fs master)
i've also tried
B> rm file.txt
B> cat file.txt
ENOENT
.> s3cmd put /tmp/junk s3://bucket/dir/file.txt
B> cat file.txt
and appears to come back w/ the contents of /tmp/junk
Hi,
When files are created/modified on any of the instances, it is successfully reflected on all instances and S3 location.
Actually we are trying to do following scenario:
- Upload a new file s3test1.html through AWS Console to S3 Bucket directory
- mountdir#> cat s3test1.html
- Actually there is no response on log file or SQS queue configured
essentially s3cmd will do the same function as dropping something w/ the aws console.
the log in on the info level will not track what files have been added/removed from the cache (perhaps we should advance that). in debug mode it will but there is quite a bit of information there.
can i get a look at your start up line?
c:/home/ewah> dir z
total 4
drwxr-xr-x 1 ewah ewah 4096 Jun 14 03:49 ./
drwx--x--x. 47 ewah ewah 4096 Nov 13 22:43 ../
-rw-r--r-- 1 ewah ewah 6785 Jun 6 16:19 .cshrc
drwxr-xr-x 1 ewah ewah 4096 Dec 31 1969 8xxxxx_ps42/
-rwxr-xr-x 1 ewah ewah 124679 Jun 14 03:49 a::a.py*
-rwxr-xr-x 1 ewah ewah 124679 Jun 14 03:54 a>a.py*
-rwxr-xr-x 1 ewah ewah 124679 Jun 14 03:48 aa a.py*
drwxr-xr-x 1 ewah ewah 4096 May 27 01:33 aaa/
drwxr-xr-x 1 ewah ewah 4096 May 27 02:00 bbb/
drwxr-xr-x 1 ewah ewah 4096 Oct 8 19:25 cc c/
-rw-r--r-- 1 ewah ewah 2151 Oct 8 19:24 d d.sql
-rw-r--r-- 1 ewah ewah 2151 Jul 24 17:00 d.sql
-rw------- 1 ewah ewah 329 Sep 10 20:52 dead.letter
-rwxr-xr-x 1 ewah ewah 2139 May 27 01:16 delta.sql*
-rwxrwxrwx 1 ewah ewah 12 Sep 10 16:17 fix found.txt*
drwxr-xr-x 1 ewah ewah 4096 Jun 6 17:07 travel/
drwxr-xr-x 1 ewah ewah 4096 Oct 8 14:26 zz/
c:/home/ewah> cd git/s3cmd
c:/home/ewah/git/s3cmd> s3cmd put ~/b.py s3://s3.140507/public/test/
WARNING: Module python-magic is not available. Guessing MIME types based on file extensions.
/home/ewah/b.py -> s3://s3.140507/public/test/b.py [1 of 1]
1528 of 1528 100% in 0s 5.08 kB/s done
c:/home/ewah/git/s3cmd> ls ~/z
8xxxxx_ps42 a>a.py aaa cc c d.sql delta.sql travel
a::a.py aa a.py bbb d d.sql dead.letter fix found.txt zz
c:/home/ewah/git/s3cmd> ls ~/z/b.py
/home/ewah/z/b.py
c:/home/ewah/git/s3cmd> ls ~/z/
8xxxxx_ps42 a>a.py aaa bbb d d.sql dead.letter fix found.txt zz
a::a.py aa a.py b.py cc c d.sql delta.sql travel
c:/home/ewah/git/s3cmd> cat ~/z/b.py
#!/usr/bin/python
...
Startup Line:
/usr/bin/yas3fs -d s3://test-bucket1/test /local/test --cache-path /local/tmp/yas3fs --topic arn:aws:sns:us-east-1:acctid:topic-name --new-queue --read-only --recheck-s3
IAM Role Policy:
S3 Bucket Policy: Allow "s3:Get_","s3:List_" for s3://test-bucket1/test
please note that we are running version: yas3fs 2.2.16
does the file show up on subsequent restarts of yas3fs?
yes, it is available on subsequent restarts.
I just merged a pull request in (slated to be 2.3.0). I didn't do anything directly w/ your issue, but would you run your tests again with that to confirm whether the bug still exists or not.
I am running v2.3.2. I am experiencing the issue. I am not running read-only. But I tested this by removing a file from s3 in the console. It doesn't get removed with out a remount on the server.