duplicate changeid's gerrit

26 views
Skip to first unread message

Åsmund Østvold

unread,
Sep 24, 2025, 8:24:29 AM (2 days ago) Sep 24
to repo-discuss
hi

I have no idea how this happened but I now have 2 changes in Gerrit that have the same changeid. So if I search for I98282084695487270b7583295f9466a4d9a678ca in the ui I get 2 changes. I have tried:

- Abandon the change. 
- Change the changeID in the ui
- Delete the change in the ui

The Gerrit version is 3.12.2.

As far as I know none of the duplicates are merged into a branch.

I have access to the actual bare repo. So I can probably find the commits that have the duplicate changeid's. But what is the correct procedure for fixing this? 

I have been running gerrit servers for 10+ years now. And this is the first time I have experienced this problem. 

Currently I have no idea on how this could have happened.

Regards,
Åsmund 

Luca Milanesio

unread,
Sep 24, 2025, 8:35:00 AM (2 days ago) Sep 24
to repo-discuss, Luca Milanesio
Hi Asmund,

On 24 Sep 2025, at 13:23, Åsmund Østvold <asm...@gmail.com> wrote:

hi

I have no idea how this happened but I now have 2 changes in Gerrit that have the same changeid.

Yes, that could happen and I’ve raised an issue two years ago, see [1].


So if I search for I98282084695487270b7583295f9466a4d9a678ca in the ui I get 2 changes. I have tried:

- Abandon the change. 
- Change the changeID in the ui
- Delete the change in the ui

The Gerrit version is 3.12.2.

As far as I know none of the duplicates are merged into a branch.

I have access to the actual bare repo. So I can probably find the commits that have the duplicate changeid's. But what is the correct procedure for fixing this? 

1. Shutdown Gerrit
2. Remove the duplicate from the bare repo (patch-sets and meta ref)
3. Offline reindex
4. Startup Gerrit


I have been running gerrit servers for 10+ years now. And this is the first time I have experienced this problem. 

You’ve been lucky I believe :-)
This has been a design issue with Gerrit since the introduction of Lucene, over 10 years ago.

Currently I have no idea on how this could have happened.

Look at the simple instructions at [1] on how to reproduce the issue.

Unfortunately there’s no fix, it’s a design issue with Gerrit itself.

HTH

Luca.


--
--
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.
To view this discussion visit https://groups.google.com/d/msgid/repo-discuss/CA%2BzfM3DKxLuEp5cMkhFF2tov5nNRGJNZ7ABFU%2Bq4X42E-9C79w%40mail.gmail.com.

Åsmund Østvold

unread,
Sep 24, 2025, 11:58:15 AM (2 days ago) Sep 24
to Luca Milanesio, repo-discuss
Thank you Luca!

On Wed, Sep 24, 2025 at 2:35 PM Luca Milanesio <luca.mi...@gmail.com> wrote:
2. Remove the duplicate from the bare repo (patch-sets and meta ref)

I tok a backup so not that much can go that bad but still.  The change that is a duplicate has number 31527. I the correct steps to do:

$ git for-each-ref "refs/changes/27/31527/*" --format='%(refname)'
refs/changes/27/31527/1
refs/changes/27/31527/meta

$ git update-ref -d refs/changes/27/31527/meta
$ git update-ref -d refs/changes/27/31527/1


Is there anything more I need to do before doing the offline reindex? 


Vitaliy L.

unread,
Sep 25, 2025, 3:01:02 AM (yesterday) Sep 25
to Repo and Gerrit Discussion
Hi

среда, 24 сентября 2025 г. в 15:24:29 UTC+3, Åsmund Østvold:
I have no idea how this happened but I now have 2 changes in Gerrit that have the same changeid. 
 
Duplicate Change-Id are OK for changes in the same project in different branches, this is done intentionally to allow cherry-picking change across branches. Here is an example for two changes with the same Change-Id on gerrit-review https://gerrit-review.googlesource.com/q/I9414b04d1c1e8b526ec6f9df6af5ca59936df660

Åsmund Østvold

unread,
Sep 25, 2025, 4:28:57 AM (yesterday) Sep 25
to Repo and Gerrit Discussion
hi,

We do pure trunk based development. No development branches. We hit the bug Luca indicated. Fortunately it is my commits that hit the issue. I do not use the UI for anything except for review and submitting changes. 

Regards,
Åsmund
Reply all
Reply to author
Forward
0 new messages