(major change in big-config mode) split the compiled config file
Fedora's config has over 11,000 repositories and the compiled config file is over 20 MB in size. Although negligible on a server class machine, on my laptop just parsing this file takes a good 2.5 seconds. Even if you use GL_ALL_READ_ALL (see a couple of commits before this one) to remove the overhead for 'read's, that's still a pretty big overhead for writes. And GL_ALL_READ_ALL is not really a solution for most people anyway. With this commit, using GL_BIG_CONFIG adds another optimisation; see doc/big-config.mkd for details (look for the word "split config" to find the section that talks about it). ---- Implementation notes: - the check for GL_NO_CREATE_REPOS has moved *into* the loop (which it completely bypassed earlier) so that write_1_compiled_conf can be called on each item
This commit is contained in:
parent
7fc1e9459f
commit
10a30c961d
9 changed files with 326 additions and 161 deletions
|
@ -23,7 +23,21 @@ $data_version = '1.7';
|
|||
'@g1' => 1,
|
||||
'@g2' => 1
|
||||
}
|
||||
},
|
||||
}
|
||||
);
|
||||
%groups = (
|
||||
'@g1' => {
|
||||
'aa' => 'master',
|
||||
'bb' => 'master'
|
||||
}
|
||||
);
|
||||
%split_conf = (
|
||||
'gitolite-admin' => 1,
|
||||
'testing' => 1
|
||||
);
|
||||
repositories/gitolite-admin.git/gl-conf
|
||||
repositories/testing.git/gl-conf
|
||||
%one_repo = (
|
||||
'gitolite-admin' => {
|
||||
'R' => {
|
||||
'tester' => 1
|
||||
|
@ -38,7 +52,9 @@ $data_version = '1.7';
|
|||
'RW+'
|
||||
]
|
||||
]
|
||||
},
|
||||
}
|
||||
);
|
||||
%one_repo = (
|
||||
'testing' => {
|
||||
'@all' => [
|
||||
[
|
||||
|
@ -55,9 +71,3 @@ $data_version = '1.7';
|
|||
}
|
||||
}
|
||||
);
|
||||
%groups = (
|
||||
'@g1' => {
|
||||
'aa' => 'master',
|
||||
'bb' => 'master'
|
||||
}
|
||||
);
|
||||
|
|
|
@ -39,8 +39,8 @@ echo "
|
|||
RW = u2 u3
|
||||
" | ugc
|
||||
|
||||
catconf
|
||||
expect_filesame $TESTDIR/out/t01-repo-groups.1
|
||||
catconfs
|
||||
expect_filesame $TESTDIR/out/t01-repo-groups.1bs
|
||||
|
||||
# ----------
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
|
@ -54,7 +54,7 @@ echo "
|
|||
RW = @g2
|
||||
" | ugc
|
||||
|
||||
catconf
|
||||
catconfs
|
||||
expect_filesame $TESTDIR/out/t01-repo-groups.2
|
||||
|
||||
name INTERNAL
|
||||
|
|
|
@ -42,8 +42,8 @@ echo "
|
|||
RW = u2 u3
|
||||
" | ugc
|
||||
|
||||
catconf
|
||||
expect_filesame $TESTDIR/out/t02-user-groups.1
|
||||
catconfs
|
||||
expect_filesame $TESTDIR/out/t02-user-groups.1bs
|
||||
|
||||
# ----------
|
||||
$TESTDIR/rollback || die "rollback failed"
|
||||
|
@ -60,7 +60,7 @@ echo "
|
|||
RW = @g2
|
||||
" | ugc
|
||||
|
||||
catconf
|
||||
expect_filesame $TESTDIR/out/t02-user-groups.2
|
||||
catconfs
|
||||
expect_filesame $TESTDIR/out/t02-user-groups.2bs
|
||||
|
||||
name INTERNAL
|
||||
|
|
|
@ -76,15 +76,21 @@ do
|
|||
cd ~/td
|
||||
name "repo on disk missing: u1"
|
||||
runlocal git clone u1:aa
|
||||
expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "1" ] && expect "R access for aa DENIED to u1"
|
||||
[ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
|
||||
|
||||
name "repo on disk missing: tester"
|
||||
runlocal git clone gitolite:aa
|
||||
expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "1" ] && expect "R access for aa DENIED to tester"
|
||||
[ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
|
||||
|
||||
name "repo on disk missing: u4"
|
||||
runlocal git clone u4:aa
|
||||
expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "0" ] && expect "fatal: 'repositories/aa.git' does not appear to be a git repository"
|
||||
[ "$bc" = "1" ] && expect "R access for aa DENIED to u4"
|
||||
[ "$bc" = "1" ] && expect "Or there may be no repository at the given path. Did you spell it correctly?"
|
||||
|
||||
name "repo on disk missing: u6"
|
||||
runlocal git clone u6:aa
|
||||
|
|
|
@ -14,6 +14,13 @@ runremote() { ssh gitolite-test@localhost "$@" > ~/1 2> ~/2; }
|
|||
listrepos() { ssh gitolite-test@localhost find repositories -type d -name "*.git" | sort > ~/1 2> ~/2; }
|
||||
# remote cat compiled pm
|
||||
catconf() { ssh gitolite-test@localhost cat .gitolite/conf/gitolite.conf-compiled.pm > ~/1 2> ~/2; }
|
||||
catconfs() {
|
||||
(
|
||||
ssh gitolite-test@localhost cat .gitolite/conf/gitolite.conf-compiled.pm
|
||||
ssh gitolite-test@localhost find repositories -name gl-conf \| sort
|
||||
ssh gitolite-test@localhost find repositories -name gl-conf \| sort \| xargs cat
|
||||
) > ~/1 2> ~/2
|
||||
}
|
||||
# remote cat ~/.gitolite.rc
|
||||
catrc() { ssh gitolite-test@localhost cat .gitolite.rc > ~/1 2> ~/2; }
|
||||
# tail gitolite logfile
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue