Replication plugin: syncing changes

99 views
Skip to first unread message

Phil Seremin

unread,
Feb 14, 2020, 11:47:24 AM2/14/20
to Repo and Gerrit Discussion
Hi,

I am trying to replicate a repo between two v3.1.3 instances of gerrit. Code is replicated fine, however I get a strange error when a change needs to be replicated:

[2020-02-14 18:21:40,641] [a4cfee7f] Replication to ssh://phil@server:port/repo.git started...
[2020-02-14 18:21:40,642] [a4cfee7f] Push to ssh://phil@server:port/repo.git references: [RemoteRefUpdate[remoteName=refs/changes/91/2291/meta, NOT_ATTEMPTED, (null)...36991deff0c8a37598339bd69a217c04bf9491d0, srcRef=refs/changes/91/2291/meta, forceUpdate, message=null]]
[2020-02-14 18:21:40,886] [a4cfee7f] Failed replicate of refs/changes/91/2291/meta to ssh://phil@server:port/repo.git, reason: NoteDb update requires -o notedb=allow
[2020-02-14 18:21:40,888] [a4cfee7f] Replication to ssh://phil@server:port/repo.git completed in 247ms, 456ms delay, 0 retries

If “notedb=allow" is a git push option I don’t know where to configure it so that the plugin can use it. Doesn’t seem to be a standard git option either.

replication.config:

[remote "gerrit-test"]
        push = +refs/*:refs/*
        push = +refs/heads/*:refs/heads/*
        push = +refs/tags/*:refs/tags/*
        push = +refs/changes/*:refs/changes/*
        threads = 1
        projects = repo
        replicationDelay = 0
        mirror = true

Would like to have some advice.

Phil

Ludovico Cavedon

unread,
Oct 21, 2020, 2:49:05 AM10/21/20
to Repo and Gerrit Discussion
Hi,

On Friday, February 14, 2020 at 8:47:24 AM UTC-8 Phil Seremin wrote:
Hi,

I am trying to replicate a repo between two v3.1.3 instances of gerrit. Code is replicated fine, however I get a strange error when a change needs to be replicated:

[2020-02-14 18:21:40,641] [a4cfee7f] Replication to ssh://phil@server:port/repo.git started...
[2020-02-14 18:21:40,642] [a4cfee7f] Push to ssh://phil@server:port/repo.git references: [RemoteRefUpdate[remoteName=refs/changes/91/2291/meta, NOT_ATTEMPTED, (null)...36991deff0c8a37598339bd69a217c04bf9491d0, srcRef=refs/changes/91/2291/meta, forceUpdate, message=null]]
[2020-02-14 18:21:40,886] [a4cfee7f] Failed replicate of refs/changes/91/2291/meta to ssh://phil@server:port/repo.git, reason: NoteDb update requires -o notedb=allow
[2020-02-14 18:21:40,888] [a4cfee7f] Replication to ssh://phil@server:port/repo.git completed in 247ms, 456ms delay, 0 retries

If “notedb=allow" is a git push option I don’t know where to configure it so that the plugin can use it. Doesn’t seem to be a standard git option either.

I hit my head against this issue for hours, so I am posting a follow-up in case someone else finds it useful.

If you were manually pushing the change ref, you would pass "-o notedb=allow" (or "--push-option notedb-allow") to the "git push" command.
However, what you need in this case is to set in the "url" in the replication configuration to point the OS SSH server running on the gerrit host (i.e. normally port 22), and not the gerrit SSH endpoint, so that gerrit replication writes directly to the filesystem and bypasses gerrit. E.g. "ssh://phil@server/home/gerrit/review_site/git/${name}.git".

I hope this helps,
Ludovico

Reply all
Reply to author
Forward
0 new messages