Stale timestamps, sizes, and contents reported for changed files when using rsync to synchronize to an S3 mount.
Steps to reproduce the issue:
Mount S3 bucket and create local file.
ifactor@dom:~$ s3fs-c somebucket S3
ifactor@dom:~$ echo Hello >foo
Copy file to S3 mount via rsync.
ifactor@dom:~$ rsync -acv foo S3/foo
sending incremental file list
foo
sent 112 bytes received 31 bytes 57.20 bytes/sec
total size is 6 speedup is 0.04
Verify original and copied file metadata match.
ifactor@dom:~$ ls -l foo S3/foo
-rw-rw-r-- 1 ifactor ifactor 6 2012-06-15 22:17 foo
-rwxrwxrwx 1 root root 6 2012-06-15 22:17 S3/foo
Change local file and re-rsync.
ifactor@dom:~$ echo World >>foo
ifactor@dom:~$ rsync -acv foo S3/foo
sending incremental file list
foo
sent 118 bytes received 31 bytes 59.60 bytes/sec
total size is 12 speedup is 0.08
Examining file via AWS console interface shows expected file timestamp and size at this point.
Original and copied file metadata (timestamp and size) do not match as expected when checked via mount.
ifactor@dom:~$ ls -l foo S3/foo
-rw-rw-r-- 1 ifactor ifactor 12 2012-06-15 22:19 foo
-rwxrwxrwx 1 root root 6 2012-06-15 22:17 S3/foo
Contents of files appear to be different as well.
ifactor@dom:~$ cat foo
Hello
World
ifactor@dom:~$ cat S3/foo
Hello
All subsequent rsync runs will recopy data, defeating the purpose of rsync.
ifactor@dom:~$ rsync -acv foo S3/foo
sending incremental file list
foo
sent 118 bytes received 31 bytes 99.33 bytes/sec
total size is 12 speedup is 0.08
ifactor@dom:~$ ls -l foo S3/foo
-rw-rw-r-- 1 ifactor ifactor 12 2012-06-15 22:19 foo
-rwxrwxrwx 1 root root 6 2012-06-15 22:17 S3/foo
Unmounting and remounting solves the problem.
ifactor@dom:~$ fusermount -u S3
ifactor@dom:~$ s3fs-c somebucket S3
ifactor@dom:~$ ls -l foo S3/foo
-rw-rw-r-- 1 ifactor ifactor 12 2012-06-15 22:19 foo
-rwxrwxrwx 1 root root 12 2012-06-15 22:20 S3/foo
This bug also affects and has been reported as
Issue 276 with the
s3fs project.