Skip to content

Commit 9d213e1

Browse files
committed
comment about reverting sync change
1 parent abfac4c commit 9d213e1

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/packages/sync-fs/README.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ The code here helps with periodically syncing a compute server and the project,
1010
where the compute server uses unionfs\-fuse combined with websocketfs, and the
1111
project uses a non\-FUSE fast local filesystem \(e.g., ext4 or zfs\). This
1212
algorithm will result in the file systems being equal if there is no activity for
13-
a few seconds. ItϨ's meant to provide a "last on to change the path wins", BUT
13+
a few seconds. It's meant to provide a "last one to change the file wins", BUT
1414
with a tolerance of maybe ~10 seconds, especially for deletes.
1515

1616
This does not use inotify or any other file watching because cocalc runs on
@@ -22,6 +22,9 @@ tree is way too much. Instead, when doing sync, we will just walk the tree.
2222
Running 'find' as a subcommand seems optimal, taking a few KB memory and about
2323
1s for several hundred thousand files.
2424

25+
26+
- TODO: This sync protocol does NOT deal with file permissions, e.g., changing a file to be executable when it wasn't, since that doesn't update the mtime. See https://github.com/sagemathinc/cocalc/issues/7342
27+
2528
## ALGORITHM
2629

2730
The actual sync works as follows. For now, we will do this periodically, possibly triggered
@@ -128,3 +131,5 @@ OK, so our protocol instead is that if the time is off by at least 10s \(say\),
128131

129132
- mtime versus ctime. We do not use ctime at all. We do use mtime, but it is used to decide in which direction to sync files when there is a conflict. It is NOT used as a threshold for whether or not to copy files at all. E.g., if you have an old file `a.c` and type `cp -a a.c a2.c` on the compute server, then `a2.c` does still get copied back to the project.
130133

134+
- mtime versus ctime, part 2: To quote the internet: "You cannot change the ctime by ordinary means. This is by design: the ctime is always updated to the current when you change any of the file's metadata, and there is no way to impose a different ctime." -- https://unix.stackexchange.com/questions/36021/how-can-i-change-change-date-of-file/36105#36105
135+

0 commit comments

Comments
 (0)