Gerrit Replication new projects not replicated?

775 views
Skip to first unread message

FuRoSh1 .

unread,
Oct 1, 2013, 2:38:03 PM10/1/13
to Repo and Gerrit Discussion
Hi Group,

I thought I tested this and created a new git-repo via the Gerrit UI (albeit under another folder where other git-repos reside) and saw my new git-repo replicated to the Gerrit slaves.

Today I tried to run a new build test and it failed. When investigating it, I found a git-repo that resided on the Gerrit MASTER but not on any of the Slaves, which means the builds will also fail on the slave-sites accessing their local gerrit slave.

I have tried to search online for the way Gerrit Replication works but not much info besides how to setup the replication.config file.

Can you please provide me areas to check so I may be able to figure out why some projects are not being replicated to the SLAVE servers? I would like to systematically go through to see if I can figure out where/why this is occurring.


Doug Kelly

unread,
Oct 1, 2013, 3:29:22 PM10/1/13
to repo-d...@googlegroups.com
The best advice I can give from experience is that if replication is set up and working when you create the project, the project is immediately mirrored to all the slaves.  This should work fine.  If the project is restricted by ACLs, sometimes permissions get out of date, so a restart of the slaves will clear the caches, and again, Gerrit should find the project.  But, if the repo didn't initialize on its own, you have to create an empty repo on the slave (in the same place as where it would be) and Gerrit will replicate the data next time you trigger a replication.

Does this help a little?

Jeff

unread,
Oct 1, 2013, 4:37:41 PM10/1/13
to repo-d...@googlegroups.com
In addition, you might want to double check the cache settings on your mirror instance.  There's a post (or doc) somewhere (I believe by Shawn) indicating recommended cache settings (essentially, very small caches).  Naturally I can't find the document today...

Depending on whether you were checking ls-projects or the mirror's filesystem, you might have actually had the project on the filesystem, but the Gerrit instance was not recognizing it.  I know we ran into that problem at one point, but I'm not sure if it was regarding new projects - or just new changes - not showing up on mirrors.  Not intended as a contradiction of what Doug mentioned, just an expansion.

FuRoSh1 .

unread,
Oct 1, 2013, 5:27:02 PM10/1/13
to Jeff, Repo and Gerrit Discussion
Thanks Jeff,

My gerrit.config is set as follows:
-------------
[cache]
        directory = cache
[cache "accounts"]
        maxAge = 5 min
[cache "accounts_byemail"]
        maxAge = 5 min
[cache "diff"]
        maxAge = 5 min
[cache "groups"]
        maxAge = 5 min
[cache "projects"]
        maxAge = 5 min
[cache "project_list"]
        maxAge = 5 min
[cache "sshkeys"]
        maxAge = 5 min
-----------

Running ls-projects to Master:
ssh -p 29418 master gerrit ls-projects | wc -l
1205

Running ls-projects to Slave:
ssh -p 29418 slave gerrit ls-projects| wc -l
1186



--
--
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 the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

FuRoSh1 .

unread,
Oct 1, 2013, 5:35:36 PM10/1/13
to Doug Kelly, Repo and Gerrit Discussion
Thanks Doug,
Thanks for the feedback!

As far as ACLs/permissions, we have master/slave setup with the same account across the WAN. Same owner:group, ssh/ssh-keys, etc across the master and slaves.

I also tried to:
1. stop/start gerrit.sh on the slave to see if it somehow would clear the cache and send over the repos not currently on the slave.
2. '$ ssh -p 29418 master gerrit plugin reload replication' to see if it catches up the slave 

However, checking the slave resulted in the same amount of ls-projects as before. No changes.

master ls-projects: 1205
slave ls-projects: 1186

Rather than checking this from time to time or daily and mkdir for list based on a diff, it seems easier to setup a rsync script to update throughout the day.
 


--

FuRoSh1 .

unread,
Oct 1, 2013, 5:38:23 PM10/1/13
to Repo and Gerrit Discussion
I'm using Gerrit Version on Master/Slaves:
gerrit version 2.5.2

Jeff

unread,
Oct 1, 2013, 5:49:30 PM10/1/13
to repo-d...@googlegroups.com

Those caches should be fine.  Does your repository have any restrictions at the ACL level? (Exclusive read, block read, etc). 

Also, have you tried simply triggering a replication? Should be something like ssh –p 29418 master gerrit replicate (though I think syntax changed in 2.5 with replication as a plugin, so your results may vary)

SeongUk Baek

unread,
Oct 14, 2013, 8:24:46 PM10/14/13
to repo-d...@googlegroups.com
Hi Kelly

Question about protocol of replication.

As far as I know, If we using replication via ssh protocol, the repos are replicated to slaves.
But If we using replication via git protocol, the repos are not replicated to slaves.

Is it right?

Martin Fick

unread,
Oct 14, 2013, 8:27:27 PM10/14/13
to repo-d...@googlegroups.com, SeongUk Baek
If you use git, you need git-daemon listening on your
destinations,

-Martin

--
The Qualcomm Innovation Center, Inc. is a member of Code
Aurora Forum, hosted by The Linux Foundation

SeongUk Baek

unread,
Oct 14, 2013, 8:31:27 PM10/14/13
to repo-d...@googlegroups.com, SeongUk Baek
Yes I know.

We are using git protocol and the git-daemon listening on slaves server.

But it's not automatically create repos in slaves when create repos in master.

Am I misunderstand?

Martin Fick

unread,
Oct 14, 2013, 8:33:00 PM10/14/13
to repo-d...@googlegroups.com, SeongUk Baek
On Monday, October 14, 2013 06:31:27 pm SeongUk Baek wrote:
> Yes I know.
>
> We are using git protocol and the git-daemon listening on
> slaves server.
>
> But it's not automatically create repos in slaves when
> create repos in master.

You do need ssh to create the repos. But you can use ssh to
create them and git to replicate. The replication config
has an admin url for creation,

SeongUk Baek

unread,
Oct 14, 2013, 9:02:43 PM10/14/13
to repo-d...@googlegroups.com, SeongUk Baek
Thanks Martin.

The replication works fine via git or ssh.

When create repos in master, I have to create manully repos in slaves using ssh.
So I made shell script about create repos in slaves.




Martin Fick

unread,
Oct 14, 2013, 9:11:14 PM10/14/13
to repo-d...@googlegroups.com
No need for a shell script, if adminUrl is set, gerrit will
create the repos on the slave when you create them on the
master. However, until recently this only happened when you
originally created the project.

With this change, it happens anytime a project is replicated
to:

https://gerrit-review.googlesource.com/#/c/49728/
Reply all
Reply to author
Forward
0 new messages