--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
On Monday, December 24, 2012 at 10:13 EST,
Chunlin Zhang <zhangc...@gmail.com> wrote:Have you tried using replication after setting up an initial mirror,
> I am trying to maintain a gerrit slave mirror using "repo init
> --mirror" under review_site/git(because I have give up to use gerrit
> replication due to big git repository issue,see my previous post)
i.e. using some other method to populate the slave and then reattempt
replication? I wouldn't be surprised if an initial replication wouldn't
work for a gigantic repository but subsequent small replications of
deltas would work just fine.
> 1. after repo init and repo sync,I found the "refs/meta/config" was
> Now I got some problems in this kind of trying:
>
> not synced because in .git "remote.origin.fetch => 2. now In slave gerrit project list,I can see ".repo/manifests"
> +refs/heads/*:refs/heads/*",after I do "git config
> remote.origin.fetch +refs/*:refs/*",I can git fetch
> "refs/meta/config",but after repo sync,it turn back to
> +refs/heads/*:refs/heads/* ,can I make it always "+refs/*:refs/*"?
> I have no idea to do this with repo(or I use a customized repo)
> ".repo/repo" this kind of git repo,can I config some directory(e.g.Just don't use Repo for this. A Repo mirror workspace isn't suitable
> .repo) to do not show in the gerrit project list?
for the task, and you've discovered why. If Gerrit replication *really*
doesn't work, use plain C Git and a cron job to push from the master
(or fetch from the slave if you prefer that).
On Wednesday, January 23, 2013 at 21:59 EST,
Chunlin Zhang <zhangc...@gmail.com> wrote:
> On Wed, Jan 23, 2013 at 10:42 PM, Magnus Bäck <ba...@google.com> wrote:
>
> > Have you tried using replication after setting up an initial mirror,Even the small delta replication after an rsync copy is in place?
> > i.e. using some other method to populate the slave and then
> > reattempt replication? I wouldn't be surprised if an initial
> > replication wouldn't work for a gigantic repository but subsequent
> > small replications of deltas would work just fine.
>
> I don't know why but it fail without meaningful log.
If even that doesn't work, you could use replication for all other gits
but skip the big one that's giving you problems.
[...]
No. You will use the ls-projects SSH command (or the equivalent REST
> > Just don't use Repo for this. A Repo mirror workspace isn't suitable
> > for the task, and you've discovered why. If Gerrit replication
> > *really* doesn't work, use plain C Git and a cron job to push from
> > the master (or fetch from the slave if you prefer that).
>
> I think it is more flexible to use repo.If I use git,I will maintain
> all the git repository by hand.
RPC) to find which projects there are. It's probably a ten-line shell
script that you can schedule on the slave via cron. A few additional
lines if you want to detect whether there were any updates to the set
of available projects or if any access rights might have been updated
so you won't have to flush the caches to often.
[...]
On Thursday, January 24, 2013 at 10:59 EST,
Chunlin Zhang <zhangc...@gmail.com> wrote:
> On Thu, Jan 24, 2013 at 10:58 PM, Magnus Bäck <ba...@google.com> wrote:
>
> > Even the small delta replication after an rsync copy is in place?Gerrit replication doesn't use rsync. What I'm asking is: Does
>
> I don't understand your method,why do gerrit replication use rsync?
replication work with your big repository if you start off by copying it
via (for example) rsync to the slave, and thereafter enable replication?
Presumably, the subsequent replication would be fairly small in size and
hopefully won't trigger whatever problem you're having when attempting
to replicate the full repository. Put differently, does the problem
appear to be related to the amount of data being pushed or is it
connected to the repository itself?
What does "git gc" and rsync have to do with other?
> > If even that doesn't work, you could use replication for all other
> > gits but skip the big one that's giving you problems.
>
> In out gerrit ,there is several big git project, after git gc,they can
> be 3+G,but before git gc they can be 80+G,so I will not use rsync.
Having to maintain three manifest branches is a lot more work. If you
> > No. You will use the ls-projects SSH command (or the equivalent REST
> > RPC) to find which projects there are. It's probably a ten-line shell
> > script that you can schedule on the slave via cron. A few additional
> > lines if you want to detect whether there were any updates to the set
> > of available projects or if any access rights might have been updated
> > so you won't have to flush the caches to often.
>
> I have to maintain 3 slave gerrit in 3 place,and I want each slave
> gerrit no have full mirror of master,but only part of all git project
> each place need to acccess.
> If I use "repo init --mirror" to maintain slave gerrit,what I want to
> do is to maintain 3 branch of mirror manifest.
> But I will try your method to see if this problem will happen.
want to have different sets of gits replicated to each location you can
have different users doing the fetching in each location and limit which
gits (or even branches within a git) they have read access to. Plus you
won't have to much around in the config file of each git to make sure
all refs are fetched by Repo.
I don't think abandoning Repo will make a difference in your case, but
using it for this purpose is a bad idea regardless.
On Thursday, January 24, 2013 at 21:38 EST,
Chunlin Zhang <zhangc...@gmail.com> wrote:[...]
> On Fri, Jan 25, 2013 at 12:09 AM, Magnus Bäck <ba...@google.com> wrote:
So run rsync after "git gc" then. Unless you only want to copy some of
> > What does "git gc" and rsync have to do with other?
>
> Because if I face the 80G+ or ever 120G+ git repository directory,rsync
> will last for long long time.
the refs in each git there shouldn't have to be a significant difference
in payload depending on whatever transport protocol you choose. Now, if
it was subsequent small replications that failed it doesn't matter.
No, you don't have to do it on the master. The script to obtain the
> > Having to maintain three manifest branches is a lot more work. If you
> > want to have different sets of gits replicated to each location you can
> > have different users doing the fetching in each location and limit which
> > gits (or even branches within a git) they have read access to. Plus you
> > won't have to much around in the config file of each git to make sure
> > all refs are fetched by Repo.
>
> Maintain three branch of manifest is easy,I can have those people(who want
> to change this) do the change themselves,they only get and push new
> manifest and then it is OK.
> Your method is also easy,but I have do it in master gerrit,so I should do
> it myself.But maybe I will choose your method,I even don't think this way.
list of projects and fetch from all can run on each slave. This should
be reasonably close to working (but should have more error handling):
for p in $(ssh ... gerrit ls-projects) ; do
if [ ! -d "$p.git" ] ; then
mkdir -p $p.git && ( cd $p.git && git init --bare && \
git remote add --mirror=fetch origin ssh://.../$p )
fi
( cd $p.git && git fetch origin && git remote prune origin)
done
Reiterating what I said before:
> > I don't think abandoning Repo will make a difference in your case, but
> > using it for this purpose is a bad idea regardless.
>
> Why? Does the repo style git repository mirror can not be compatible with
> regular git?
- You'll have to maintain the manifest files.
- You'll either have to maintain the config files in the gits or
maintain a modified copy of Repo to get Repo to fetch all refs.
- The project list on the client will have bogus .repo/manifests and
.repo/repo entries.
The drawback with dropping Repo:
- You'll have to write a ten-line shell script. And I just wrote it
for you.
No, you don't have to do it on the master. The script to obtain the
list of projects and fetch from all can run on each slave. This should
be reasonably close to working (but should have more error handling):
for p in $(ssh ... gerrit ls-projects) ; do
if [ ! -d "$p.git" ] ; then
mkdir -p $p.git && ( cd $p.git && git init --bare && \
git remote add --mirror=fetch origin ssh://.../$p )
fi
( cd $p.git && git fetch origin && git remote prune origin)
doneOK,many thanks to your script,I will follow your method,and try if it have the issue of losing projects&groups
I have try your method,and found the git sync very OK,this is a clean way,but the gerrit still lost projects&groups.So I begin to try debuging gerrit now ...
On Fri, Jan 25, 2013 at 4:17 PM, Björn Pedersen <ice...@googlemail.com> wrote:
thanks to your script,I will follow your method,and try if it have the issue of losing projects&groupsI have try your method,and found the git sync very OK,this is a clean way,but the gerrit still lost projects&groups.So I begin to try debuging gerrit now ...
Hi.
probably you have to explicitly fetch at least the All-Projects. a normal ls-projects will only list "real" projects.
You can use the --type argument to ls-projects to change that. Just run ssh ... gerrit ls-projects -h(forgot to reply all)I use --type ALL but still having this issue,only 2 manifest can be seen.But I don't know if I use --tree,what meaning is the (x) in the output?t$ ssh testmirr gerrit ls-projects --type ALL --tree`-- (x)|-- (x)|-- modem/manifest|-- platform/manifest`-- (x)
--
--
To unsubscribe, email repo-discuss...@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en
---
You received this message because you are subscribed to a topic in the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/repo-discuss/X4mKjLhJx-8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to repo-discuss...@googlegroups.com.