forum/mesh configurationsgit-annexhttp://git-annex.branchable.com/forum/mesh_configurations/git-annexikiwiki2015-09-21T20:22:40Zcomment 1http://git-annex.branchable.com/forum/mesh_configurations/comment_1_0712fa3d50ca6092bd7d98c945b5cc31/joey2015-08-19T16:48:49Z2015-08-19T16:40:16Z
<p>It's easy to see why a file is not copied from source repo A to source repo
B: The preferred content expression for a source repo is "not (copies=1)",
so a source repo will not want to get any files from any other repo.</p>
<p>You probably want to make the central repo use transfer; that's basically
what it's for. Note that a transfer repo hangs onto file content until it
reaches all client repos. So you might want to change the preferred content
expression to refer to backup repos. Something as simple as this might
work:</p>
<pre><code>not inallgroup=backup
</code></pre>
<p>I don't see any reason why a file wouldn't move from B to backup repo C,
but I don't see anything in your transcript that shows that not happening
either. Your transcript doesn't actually show running any git-annex commands
that move file contents at all; no git annex copy/move, and the sync is not
run with --content...</p>
clarificationshttp://git-annex.branchable.com/forum/mesh_configurations/comment_2_0d9ba4017343475a96975145c9db29c5/anarcat2015-08-19T16:57:49Z2015-08-19T16:57:49Z
<p>the assistant is runnin on repos a and b. i was expecting it to move the files automatically.</p>
<p>about repo groups, if i understand correctly, it should be:</p>
<ul>
<li><code>a</code>: <em>source</em></li>
<li><code>b</code>: <em>transfer</em> (or <em>not inallgroup=backup</em>?)</li>
<li><code>c</code>: <em>backup</em></li>
</ul>
<p>is that correct?</p>
comment 3http://git-annex.branchable.com/forum/mesh_configurations/comment_3_d228158cf00cd04dc9ef5602acebdaac/joey2015-08-19T17:07:46Z2015-08-19T17:04:30Z
<p>Your transcript doesn't show the assistant running. It's not clear that, in
your live deployment, any files ever got to repo B for the assistant there
to deal with.</p>
<p>Repos such as B need a preferred content expression like the one I gave. It
doesn't matter a whole lot what group is used for them; overriding the
groupwanted for the transfer group to use that expression would be one way
to do it.</p>
comment 4http://git-annex.branchable.com/forum/mesh_configurations/comment_4_d5c8e99cadf976434460d6d0f410136e/anarcat2015-08-19T17:17:50Z2015-08-19T17:17:50Z
<p>darn, you're right... then i screwed up my copy-paste. <img src="http://git-annex.branchable.com/smileys/sad.png" alt=":(" /> the assistant <em>was</em> running on a and b, that i am sure of.</p>
<p>here's a more complete transcript (hopefully):</p>
<pre>
[997]anarcat@desktop008:test$ mkdir g-a
[998]anarcat@desktop008:test$ cd g-a/
[999]anarcat@desktop008:g-a$ git init a
Initialized empty Git repository in /home/anarcat/test/g-a/a/.git/
[1000]anarcat@desktop008:g-a$ git init b
Initialized empty Git repository in /home/anarcat/test/g-a/b/.git/
[1001]anarcat@desktop008:g-a$ git init c
Initialized empty Git repository in /home/anarcat/test/g-a/c/.git/
[1002]anarcat@desktop008:g-a$ cd a
[1003]anarcat@desktop008:a$ git annex init
init ok
(recording state in git...)
[1004]anarcat@desktop008:a$ git remote add origin ../b
[1005]anarcat@desktop008:a$ cd ../b
[1006]anarcat@desktop008:b$ git annex init
init ok
(recording state in git...)
[1007]anarcat@desktop008:b$ git remote add origin ../c
[1008]anarcat@desktop008:b$ cd ../c
[1009]anarcat@desktop008:c$ git annex init
init ok
(recording state in git...)
[1010]anarcat@desktop008:c$ cd ../a/
[1011]anarcat@desktop008:a$ git annex ^C
[1011]anarcat@desktop008:a130$ touch test
[1012]anarcat@desktop008:a$ git annex add tset
git-annex: tset not found
git-annex: add: 1 failed
[1013]anarcat@desktop008:a1$ git annex add test
add test ok
(recording state in git...)
[1014]anarcat@desktop008:a$ git annex sync
commit ok
pull origin
warning: no common commits
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 5 (delta 0), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From ../b
* [new branch] git-annex -> origin/git-annex
ok
(merging origin/git-annex into git-annex...)
(recording state in git...)
push origin
Counting objects: 16, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (12/12), done.
Writing objects: 100% (16/16), 1.56 KiB | 0 bytes/s, done.
Total 16 (delta 1), reused 0 (delta 0)
To ../b
* [new branch] git-annex -> synced/git-annex
* [new branch] master -> synced/master
ok
[1015]anarcat@desktop008:a$ git annex assistant
[1016]anarcat@desktop008:a$ cd ../b
[1017]anarcat@desktop008:b$ git annex assistant
[1018]anarcat@desktop008:b$ ls
[1019]anarcat@desktop008:b$ git anne^C
[1019]anarcat@desktop008:b130$ ls
[1019]anarcat@desktop008:b$ git annex sync
commit ok
pull origin
merge: refs/remotes/origin/master - not something we can merge
merge: refs/remotes/origin/synced/master - not something we can merge
failed
git-annex: sync: 1 failed
[1020]anarcat@desktop008:b1$ git remote -v^C
[1020]anarcat@desktop008:b130$ git re^C
[1020]anarcat@desktop008:b130$ ls
[1021]anarcat@desktop008:b$ cd ../
[1022]anarcat@desktop008:g-a$ git annexccd ^C
[1022]anarcat@desktop008:g-a130$ cd c
[1023]anarcat@desktop008:c$ git annex sync
commit ok
[1024]anarcat@desktop008:c$ ls
[1025]anarcat@desktop008:c$ cd ../b
[1026]anarcat@desktop008:b$ git co master
error: pathspec 'master' did not match any file(s) known to git.
[1027]anarcat@desktop008:b1$ git branch -a
git-annex
synced/git-annex
synced/master
remotes/origin/git-annex
[1028]anarcat@desktop008:b$ git co -b master synced/master
Already on 'master'
[1029]anarcat@desktop008:b$ ls
test
[1030]anarcat@desktop008:b$ git annex sync
commit ok
pull origin
ok
[1031]anarcat@desktop008:b$ cd ..c
bash: cd: ..c: No such file or directory
[1032]anarcat@desktop008:b1$ cd ../c
[1033]anarcat@desktop008:c$ ls
[1034]anarcat@desktop008:c$ git annex sync
(recording state in git...)
commit ok
[1035]anarcat@desktop008:c$ ls
[1036]anarcat@desktop008:c$ cd ../a
[1037]anarcat@desktop008:a$ echo test > foo
[1038]anarcat@desktop008:a$ ls -al
total 20K
drwxr-xr-x 3 anarcat 4294967294 4096 aoû 19 13:12 .
drwxr-xr-x 5 anarcat 4294967294 4096 aoû 19 13:10 ..
lrwxrwxrwx 1 anarcat 4294967294 178 aoû 19 13:12 foo -> .git/annex/objects/w8/pv/SHA256E-s5--f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2/SHA256E-s5--f2ca1bb6c7e907d06dafe4687e579fce76b37e4e93b7605022da52e6ccc26fd2
drwxr-xr-x 10 anarcat 4294967294 4096 aoû 19 13:12 .git
lrwxrwxrwx 1 anarcat 4294967294 178 aoû 19 13:11 test -> .git/annex/objects/pX/ZJ/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855/SHA256E-s0--e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
[1039]anarcat@desktop008:a$ git status
On branch master
nothing to commit, working directory clean
[1040]anarcat@desktop008:a$ git annex list
here
|origin
||web
|||bittorrent
||||
XX__ foo
XX__ test
[1041]anarcat@desktop008:a$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||
XX__ foo
XX__ test
[1042]anarcat@desktop008:a$ cd ../b
[1043]anarcat@desktop008:b$ git annex wanted transfer
git-annex: there is no available git remote named "transfer"
[1044]anarcat@desktop008:b1$ git annex wanted . transfer
wanted . git-annex: Parse error: Parse failure: near "transfer"
[1045]anarcat@desktop008:b1$ git annex wanted . groupwanted
wanted . ok
(recording state in git...)
[1046]anarcat@desktop008:b$ git annex group . transfer
group . c ok
(recording state in git...)
[1047]anarcat@desktop008:b$ cd ../a
[1048]anarcat@desktop008:a$ git annex group . source
group . ok
(recording state in git...)
[1049]anarcat@desktop008:a$ git annex wanted . groupwanted
wanted . ok
(recording state in git...)
[1050]anarcat@desktop008:a$ cd ../c
[1051]anarcat@desktop008:c$ git annex wanted . groupwanted
wanted . ok
(recording state in git...)
[1052]anarcat@desktop008:c$ git annex group . backup
group . (merging synced/git-annex into git-annex...)
(recording state in git...)
ok
(recording state in git...)
[1053]anarcat@desktop008:c$ cd ../
[1054]anarcat@desktop008:g-a$ cd b
[1055]anarcat@desktop008:b$ cd ../a
[1056]anarcat@desktop008:a$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||
XX__ foo
XX__ test
[1057]anarcat@desktop008:a$ git annex^C
[1057]anarcat@desktop008:a130$ cd ../
[1058]anarcat@desktop008:g-a$ git ^C
[1058]anarcat@desktop008:g-a130$ cd b
[1059]anarcat@desktop008:b$ git remote -v
origin ../c (fetch)
origin ../c (push)
[1060]anarcat@desktop008:b$ git annex sync
commit ok
pull origin
remote: Counting objects: 23, done.
remote: Compressing objects: 100% (19/19), done.
remote: Total 23 (delta 8), reused 0 (delta 0)
Unpacking objects: 100% (23/23), done.
From ../c
ac66bb1..43cfe35 git-annex -> origin/git-annex
ok
(merging origin/git-annex into git-annex...)
[1061]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
XX__X foo
XX__X test
[1062]anarcat@desktop008:b$ cd ../a/
[1063]anarcat@desktop008:a$ echo bar > bar
[1064]anarcat@desktop008:a$ git status
On branch master
nothing to commit, working directory clean
[1065]anarcat@desktop008:a$ cd ^C
[1065]anarcat@desktop008:a130$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||
XX__ bar
XX__ foo
XX__ test
[1066]anarcat@desktop008:a$ cd ../b
[1067]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
XX__X bar
XX__X foo
XX__X test
</pre>
<p>now it seems that setting repo <code>b</code> in the transfer group helped, but the files didn't get purged from <code>a</code> (or <code>b</code>, for that matter).</p>
<p>setting the central <code>b</code> wanted expression seems to help in dropping the file from <code>a</code>, but not from <code>b</code>:</p>
<pre>
[1070]anarcat@desktop008:b$ cd ../a
[1071]anarcat@desktop008:a$ echo quuex > quuex
[1072]anarcat@desktop008:a$ git status
On branch master
nothing to commit, working directory clean
[1073]anarcat@desktop008:a$ cd -
/home/anarcat/test/g-a/b
[1074]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
XX__X bar
XX__X foo
X___X quuex
XX__X test
[1075]anarcat@desktop008:b$ cd ../c
[1076]anarcat@desktop008:c$ git annex group
git-annex: Specify a repository and a group.
[1077]anarcat@desktop008:c1$ git annex group .
(recording state in git...)
backup
[1078]anarcat@desktop008:c$ cd -
/home/anarcat/test/g-a/b
[1079]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
XX__X bar
XX__X foo
X___X quuex
XX__X test
[1080]anarcat@desktop008:b$ git annex numcopies
global numcopies is not set
(default is 1)
</pre>
<p>i think i'm almost getting this now. <img src="http://git-annex.branchable.com/smileys/smile.png" alt=":)" /></p>
comment 5http://git-annex.branchable.com/forum/mesh_configurations/comment_5_a181fde7b7f6d0559331e1afa395ba0a/joey2015-08-19T17:56:59Z2015-08-19T17:54:36Z
<p>You have B configured as a regular transfer repo, so it only wants to drop
files once they have reached some client repos. Settings its preferred
content to "not inallgroup=backup" should fix that.</p>
<p>Also, the assistant can notice some configuration changes that are made
while it's running, but maybe not all of them, and maybe it won't rescan
files to transfer right away after such a change is made. I'd use <code>git
annex sync --content</code> to test such changes, and save the assistant for once
I have a working setup.</p>
comment 6http://git-annex.branchable.com/forum/mesh_configurations/comment_6_7cb33d2416289f744828d8d9d24e9ef6/anarcat2015-08-19T18:13:22Z2015-08-19T18:13:22Z
<p>right, i thought as well that the assistant wouldn't pickup some stuff...</p>
<p>but <code>sync --content</code> doesn't behave as expected either:</p>
<pre>
[1081]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
XX__X bar
XX__X foo
X___X quuex
XX__X test
[1082]anarcat@desktop008:b$ git annex sync --content
commit ok
pull origin
remote: Counting objects: 6, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 6 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (6/6), done.
From ../c
29d3b7b..6afbb52 git-annex -> origin/git-annex
ok
(merging origin/git-annex into git-annex...)
(recording state in git...)
(recovering from race...)
drop bar ok
drop foo ok
drop test ok
pull origin
ok
(recording state in git...)
push origin
Counting objects: 18, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (18/18), 1.47 KiB | 0 bytes/s, done.
Total 18 (delta 11), reused 0 (delta 0)
To ../c
873a124..8390704 git-annex -> synced/git-annex
ok
[1083]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
_X__X bar
_X__X foo
X___X quuex
_X__X test
[1084]anarcat@desktop008:b$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/a
|||||
_X__X bar
_X__X foo
X___X quuex
_X__X test
[1084]anarcat@desktop008:b$ git annex wanted .
not inallgroup=backup
[1085]anarcat@desktop008:b$ cd ../a
[1086]anarcat@desktop008:a$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||
XX__ bar
XX__ foo
XX__ quuex
XX__ test
[1087]anarcat@desktop008:a$ git annex sync --content
commit ok
pull origin
remote: Counting objects: 114, done.
remote: Compressing objects: 100% (94/94), done.
remote: Total 114 (delta 54), reused 0 (delta 0)
Receiving objects: 100% (114/114), 9.20 KiB | 0 bytes/s, done.
Resolving deltas: 100% (54/54), completed with 6 local objects.
From ../b
de5f95e..158c3cc git-annex -> origin/git-annex
ok
(merging origin/git-annex into git-annex...)
pull origin
ok
[1088]anarcat@desktop008:a$ git annex list --allrepos
here
|origin
||web
|||bittorrent
||||anarcat@desktop008:~/test/g-a/c
|||||
X___X bar
X___X foo
XX___ quuex
X___X test
[1089]anarcat@desktop008:a$ git annex wanted .
groupwanted
[1090]anarcat@desktop008:a$ git annex group .
source
</pre>
<p>files are still not removed from <code>a</code> and a few of them were dropped from <code>b</code>, but not all of them. but worse, one file still isn't sent to the backup server <code>c</code> at all.</p>
comment 7http://git-annex.branchable.com/forum/mesh_configurations/comment_7_6c9d499f64067ee9d3721dc763f3c425/joey2015-08-19T18:55:14Z2015-08-19T18:51:42Z
<p>I'm afraid I don't have time to continue to read and try to debug
transcripts of this being set up incorrectly in various ways.</p>
<p>So, here's a transcript of the configuration I described, which seems to be
working as I'd expect it to work:</p>
<pre><code>joey@darkstar:~/tmp>mkdir bench
joey@darkstar:~/tmp>cd bench
joey@darkstar:~/tmp/bench>git init A
Initialized empty Git repository in /home/joey/tmp/bench/A/.git/
joey@darkstar:~/tmp/bench>cd A
joey@darkstar:~/tmp/bench/A>git annex init
init ok
(recording state in git...)
joey@darkstar:~/tmp/bench/A>git annex wanted . standard
wanted . ok
(recording state in git...)
joey@darkstar:~/tmp/bench/A>git annex group . source
group . ok
(recording state in git...)
joey@darkstar:~/tmp/bench/A>date > somefile
joey@darkstar:~/tmp/bench/A>git annex add
add somefile ok
(recording state in git...)
joey@darkstar:~/tmp/bench/A>git commit -m added
[master (root-commit) 4a322e1] added
1 file changed, 1 insertion(+)
create mode 120000 somefile
joey@darkstar:~/tmp/bench/A>cd ..
joey@darkstar:~/tmp/bench>git clone A B
Cloning into 'B'...
done.
joey@darkstar:~/tmp/bench>cd B
joey@darkstar:~/tmp/bench/B>git annex wanted . "not inallgroup=backup"
(merging origin/git-annex into git-annex...)
(recording state in git...)
wanted . ok
(recording state in git...)
joey@darkstar:~/tmp/bench/B>cd ..
joey@darkstar:~/tmp/bench>git clone B C
Cloning into 'C'...
done.
joey@darkstar:~/tmp/bench>cd C
joey@darkstar:~/tmp/bench/C>git annex group . backup
(merging origin/git-annex into git-annex...)
(recording state in git...)
group . ok
(recording state in git...)
joey@darkstar:~/tmp/bench/C>git annex wanted . standard
wanted . ok
(recording state in git...)
joey@darkstar:~/tmp/bench/C>cd ..
joey@darkstar:~/tmp/bench>cd B
joey@darkstar:~/tmp/bench/B>git remote add A ../A
joey@darkstar:~/tmp/bench/B>git remote add C ../C
</code></pre>
<p>Now observe sync moving the file from A thru B to C:</p>
<pre><code>joey@darkstar:~/tmp/bench/B>git annex sync --content
commit ok
pull origin
ok
pull C
remote: Counting objects: 10, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 10 (delta 3), reused 0 (delta 0)
Unpacking objects: 100% (10/10), done.
From ../C
* [new branch] git-annex -> C/git-annex
* [new branch] master -> C/master
ok
pull A
From ../A
* [new branch] git-annex -> A/git-annex
* [new branch] master -> A/master
ok
(merging C/git-annex into git-annex...)
get somefile (from origin...) ok
copy somefile copy somefile (to C...) ok
drop somefile ok
drop origin somefile ok
pull origin
ok
pull C
ok
pull A
ok
(recording state in git...)
push origin
Counting objects: 21, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (19/19), done.
Writing objects: 100% (21/21), 2.19 KiB | 0 bytes/s, done.
Total 21 (delta 7), reused 0 (delta 0)
To /home/joey/tmp/bench/A
* [new branch] git-annex -> synced/git-annex
* [new branch] master -> synced/master
ok
push C
Counting objects: 5, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (5/5), 474 bytes | 0 bytes/s, done.
Total 5 (delta 2), reused 0 (delta 0)
To ../C
* [new branch] git-annex -> synced/git-annex
* [new branch] master -> synced/master
ok
push A
Everything up-to-date
ok
joey@darkstar:~/tmp/bench/B>git annex whereis
whereis somefile (1 copy)
65092dc3-ea1e-4267-89b7-5fcb8df2c6ae -- joey@darkstar:~/tmp/bench/C [C]
ok
</code></pre>
<p>Er, the 'A' remote in 'B' was unnecessary since A is origin. But otherwise, I think that's what you asked for.. HTH.</p>
works with sync --content, but the assistant is slow to pickup tracking infohttp://git-annex.branchable.com/forum/mesh_configurations/comment_8_a2b5da1ea55a222dd30f0e982d5ee807/anarcat2015-08-19T23:56:07Z2015-08-19T20:29:46Z
<p>well, this is not exactly the topology i have here.</p>
<p>you setup a topology like this:</p>
<pre><code>A <- B <-> C
</code></pre>
<p><code>X <- Y</code> means <code>X is a remote of Y</code>.</p>
<p>My topology is:</p>
<pre><code>A -> B -> C
</code></pre>
<p>So B can't directly manage objects from A. It can <em>receive</em> objects from it, but that's it.</p>
<p>So here's a clearer transcript of the session, using the same semantics you have been using for the different repos, but with the remotes setup differently, as I describe above:</p>
<pre>
[1113]anarcat@desktop008:bench$ git init B
Initialized empty Git repository in /home/anarcat/test/bench/B/.git/
[1114]anarcat@desktop008:bench$ cd B/
[1115]anarcat@desktop008:B$ git annex init
init ok
(recording state in git...)
[1116]anarcat@desktop008:B$ date > somefile
[1117]anarcat@desktop008:B$ git annex add
add somefile ok
(recording state in git...)
[1118]anarcat@desktop008:B$ git commit -madded
[master (root-commit) d2f6177] added
1 file changed, 1 insertion(+)
create mode 120000 somefile
[1119]anarcat@desktop008:B$ git annex wanted . "not inallgroup=backup"
wanted . ok
(recording state in git...)
[1138]anarcat@desktop008:B$ git remote add C ../C # actually did that later
[1120]anarcat@desktop008:B$ cd ../
[1121]anarcat@desktop008:bench$ git clone -o B B A
Cloning into 'A'...
done.
[1122]anarcat@desktop008:bench$ git clone B C
Cloning into 'C'...
done.
[1123]anarcat@desktop008:bench$ cd A
[1124]anarcat@desktop008:A$ git annex wanted . standard
(merging B/git-annex into git-annex...)
(recording state in git...)
wanted . ok
(recording state in git...)
[1125]anarcat@desktop008:A$ git annex group . source
group . ok
(recording state in git...)
[1126]anarcat@desktop008:A$ cd ../C
[1127]anarcat@desktop008:C$ git annex wanted . standard
(merging origin/git-annex into git-annex...)
(recording state in git...)
wanted . ok
(recording state in git...)
[1128]anarcat@desktop008:C$ git annex group . backup
group . ok
(recording state in git...)
[1142]anarcat@desktop008:C$ git remote rm origin # because this is S3 in production, and can't do anything on its own
</pre>
<p>And of course now, it actually works fine, with <code>sync --content</code>:</p>
<pre>
[1144]anarcat@desktop008:A$ git annex sync --content
commit ok
pull B
remote: Counting objects: 20, done.
remote: Compressing objects: 100% (18/18), done.
remote: Total 20 (delta 8), reused 0 (delta 0)
Unpacking objects: 100% (20/20), done.
From /home/anarcat/test/bench/B
d2f6177..b625a42 master -> B/master
0432685..2061cf9 git-annex -> B/git-annex
ok
(merging B/git-annex into git-annex...)
copy otherfile copy otherfile (to B...) ok
drop otherfile ok
pull B
ok
(recording state in git...)
push B
Counting objects: 8, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (6/6), done.
Writing objects: 100% (8/8), 720 bytes | 0 bytes/s, done.
Total 8 (delta 3), reused 0 (delta 0)
To /home/anarcat/test/bench/B
0432685..e0fccbd git-annex -> synced/git-annex
ok
[1145]anarcat@desktop008:A$ cd ../B
[1146]anarcat@desktop008:B$ git annex sync --content
commit ok
pull C
remote: Counting objects: 5, done.
remote: Compressing objects: 100% (4/4), done.
remote: Total 5 (delta 2), reused 0 (delta 0)
Unpacking objects: 100% (5/5), done.
From ../C
2061cf9..1d0a3d5 git-annex -> C/git-annex
ok
(merging C/git-annex into git-annex...)
(recording state in git...)
copy otherfile copy otherfile (to C...) ok
drop otherfile ok
pull C
ok
(recording state in git...)
push C
Counting objects: 20, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (16/16), done.
Writing objects: 100% (20/20), 1.55 KiB | 0 bytes/s, done.
Total 20 (delta 10), reused 0 (delta 0)
To ../C
2061cf9..86a892f git-annex -> synced/git-annex
ok
[1147]anarcat@desktop008:B$ git annex list
here
|C
||web
|||bittorrent
||||
_X__ otherfile
_X__ somefile
</pre>
<p>Now, that's all great for <code>sync --content</code> - but what about the assistant?</p>
<pre>
[1150]anarcat@desktop008:B$ git annex assistant
[1151]anarcat@desktop008:B$ cd ../A
[1152]anarcat@desktop008:A$ git annex assistant
[1154]anarcat@desktop008:A$ date > foo
[1157]anarcat@desktop008:A$ git annex list --allrepos
here
|B
||web
|||bittorrent
||||anarcat@desktop008:~/test/bench/C
|||||
_X___ foo
____X otherfile
____X somefile
[1158]anarcat@desktop008:A$ sleep 600; git annex list --allrepos
here
|B
||web
|||bittorrent
||||anarcat@desktop008:~/test/bench/C
|||||
_X___ foo
____X otherfile
____X somefile
</pre>
<p>so from <code>A</code>'s perspective, it looks like the file didn't migrate properly. <em>but</em> it actually did!</p>
<pre>
[1159]anarcat@desktop008:A$ cd ../B
[1160]anarcat@desktop008:B$ git annex list --allrepos
here
|C
||web
|||bittorrent
||||anarcat@desktop008:~/test/bench/A
|||||
_X___ foo
_X___ otherfile
_X___ somefile
[1161]anarcat@desktop008:B$ cd -
/home/anarcat/test/bench/A
[1162]anarcat@desktop008:A$ git annex list --allrepos
here
|B
||web
|||bittorrent
||||anarcat@desktop008:~/test/bench/C
|||||
_X___ foo
____X otherfile
____X somefile
</pre>
<p>how long does it take for the assistant to start syncs like this? are those timers user-accessible somehow? this problem sure looks like <a href="http://git-annex.branchable.com/bugs/sync-git-annex_branch_not_syncing_in_the_assistant/">sync-git-annex branch not syncing in the assistant</a> - but maybe i'm confused there as well.</p>
<p>anyways, it does seem like content actually does gets synced around properly by the assistant. i'll try to deploy the new preferred content expression in production and report back here.</p>
<p>and sorry for the noisy pastes and hand-holding, but i was thoroughly confused by this one. i thought i had a good grasp on preferred content and all that, but it seems i was wrong... <img src="http://git-annex.branchable.com/smileys/sad.png" alt=":(" /></p>
a bit more info and solutionshttp://git-annex.branchable.com/forum/mesh_configurations/comment_9_ac3e1faaefaed222f725345ab4b5f01a/anarcat2015-08-20T14:09:54Z2015-08-20T14:09:54Z
<p>so short version here: thanks for your help and i figured it, there were problems with the S3 credentials perms not respecting <code>sharedRepository</code>, multiple group support confusion, bare/non-bare, groupwanted vs standard confusion and so on... now the files are migrating properly in production. hurray! i believe documentation could be improved, and i have questions about timeouts, below.</p>
<p>so one thing that was definitely broken in production was that, on the central server, the S3 credentials were accessible only to the user that ran the "enable s3" command (that is <code>anarcat</code>). it was <em>not</em> accessible to the user actually running the assistant (the <code>git-annex</code> sandbox account), which made it simply impossible for the assistant to upload files to s3. so maybe one problem here is that the <code>.git/annex/creds</code> file do not respect the <code>core.sharedRepository = group</code> setting i have there...</p>
<p>another problem in production, of course, was the <em>transfer</em> preferred group setting. once changed to <code>not inallgroup=backup</code>, things were better... but it was still keeping too many files. the problem then was that the repo was originally set to the <em>source</em> group (PEBKAC here again, sorry) and then it was <em>added</em> to the <em>standard</em> group, with the <code>git annex group . standard</code> command. i didn't expect that: i expected the group command to <em>change</em> the group, not to add to it. the documentation (<a href="http://git-annex.branchable.com/git-annex-group/">git-annex-group</a>) is clear enough, however, so this is yet another PEBKAC.</p>
<p>Another possible problem is that the central server (<code>b</code>) is not a bare git repository. I am not sure why it was setup that way... maybe i was worried about bare repo suport and past experiences, or concerns about being able to actually interact with the files directly on the central server. i had to do <code>git co -b master synced/master</code> to eventually see the files locally, and this helped a little in diagnosing all of this.</p>
<p>A problem remained after that though: files are <em>still</em> not removed from <code>A</code> in my tests in production. i don't understand why: <code>A</code> is setup as a source repository:</p>
<pre>
antoine@ip-10-88-150-10:/mnt/media$ git annex group .
sourcethis
antoine@ip-10-88-150-10:/mnt/media$ git annex wanted .
groupwanted
</pre>
<p>yet some files have more than one copy:</p>
<pre>
antoine@ip-10-88-150-10:/mnt/media$ git annex list test
here
|origin
||s3
|||web (untrusted)
||||bittorrent
|||||
X_X__ test/motd
__X__ test/test1
__X__ test/test2
__X__ test/test3
</pre>
<p>Indeed, it doesn't sem to want to drop that local file:</p>
<pre>
antoine@ip-10-88-150-10:/mnt/media$ git annex list --want-drop test
here
|origin
||s3
|||web (untrusted)
||||bittorrent
|||||
__X__ test/test1
__X__ test/test2
__X__ test/test3
</pre>
<p>It turns out that I had documentation wrong again about that as well: i was using <em>groupwanted</em> as a <code>wanted</code> expression, but the groups were standard groups, so git-annex was just failing to use the proper content expression. setting the <code>wanted</code> expression back to standard (yes, again as you showed, sorry about that) fixed the problem:</p>
<pre>
antoine@ip-10-88-150-10:/mnt/media$ sudo -u www-data -H git annex wanted . standard
wanted . ok
(recording state in git...)
antoine@ip-10-88-150-10:/mnt/media$ git annex list --want-drop test
here
|origin
||s3
|||web (untrusted)
||||bittorrent
|||||
X_X__ test/motd
__X__ test/test1
__X__ test/test2
__X__ test/test3
antoine@ip-10-88-150-10:/mnt/media$ sudo -u www-data -H git annex drop --auto test
drop test/motd ok
(recording state in git...)
</pre>
<p>hurray!</p>
<p>again, i apologise for all the hand holding here... as a software developper myself, i understand how frustrating it can be to try to make users come out of their cave of ignorance and see the light of day...</p>
<p>but i do feel there could be more work done to clarify how all of this works. i will certainly try to give a few kicks in the <a href="http://git-annex.branchable.com/forum/preferred_content/">preferred content</a> section and maybe this forum post will be helpful for future endeavors... or maybe just write up a new tips page about such hairy setups?</p>
<p>the questions that remain here for me are:</p>
<ul>
<li>how long does the assistant wait before refreshing the wanted content expressions</li>
<li>how long it waits before triggering syncs</li>
<li>are those timeouts configurable</li>
</ul>
<p>thanks so much for helping us through this, it's really appreciated!</p>
comment 10http://git-annex.branchable.com/forum/mesh_configurations/comment_10_dc99216ee2fc0bd3d43234915a0305ab/joey2015-09-21T20:22:40Z2015-09-21T18:44:20Z
<p>I'm not comfortable making core.sharedrepository settings affect creds
files. You don't normally want to give out S3 creds to other users in a
unix group. And in the "everybody" case, it certianly seems entirely wrong
to make the creds files world-readable. Willing to live with a little
inconsistency here in order to not blow user's bank accounts off. It would
be good to document it somewhere.</p>
<p>Your paste seems to show A as being in the "sourcethis" group, not the
"source" group. I don't know what that means.</p>
<p>The assistant should notice config changes to the git-annex branch within
60 seconds of them being received. Syncs happen when changes are detected,
or every 30 minutes.</p>