Reindex problem - few questions

328 views
Skip to first unread message

Robert Mitwicki

unread,
Jun 23, 2016, 4:10:44 AM6/23/16
to Repo and Gerrit Discussion
Hi all,

I would like to ask few question regarding the reindex feature (offline and online).
Just to give you a context:

I wanted to rename one of the project on gerrit. So basically I fallowed one of the tutorial which I found on this mailing list.
The problem is that for some reason (to those who are curious I forgot to press commit in Oracle - yep) I did not perform changes in the database before starting reindexing.

So basically it should go like this:

UPDATE CHANGES set DEST_PROJECT_NAME='projA' where DEST_PROJECT_NAME='projB';
update ACCOUNT_PROJECT_WATCHES SET PROJECT_NAME = 'projA' where PROJECT_NAME = 'projB';

and the do the reindexing. But as I already mentioned I forgot to commit those changes so the database didn't changed.
I renamed git repository on the file system.

So after few hours of reindexing (offline reindexing) system was back online but the problem is that non of the change from 'projB/projA' was visible in the gerrit (If I knew the change id I could open it but could not search for it nor see it on dashboard).
I thought that I will just change the database (this time press the commit :) ) and do the online reindexing (gerrit v 2.11.4) as I didn't wanted to block developers this time.

The problem is that as soon as I will try to do it:

ssh gerrit-host gerrit index start

and I am getting:
Nothing to reindex, index is already the latest version

Items are still not available on the dashboards nor over search.
Just to mention that as soon as I will touch one of the change (like leave a commend, add reviewer) it will appear back on the dashboard (The index is refreshed? )

And here are the questions:
Is there a way to force online reindexing - skip this check?
Is there a way to limit reindexing (offline/online) just to one project?
If I will change the number in gerrit_index.config to a lower one will this help somehow (like allow me to run it)?
Since the database didn't change why the reindex happend? Why it took so long (over few hours) - could be that the index was low because someone forgot to reindex database after one of the upgrade?


Thanks a lot for explanation.
Best regards
Robert

Saša Živkov

unread,
Jun 23, 2016, 4:52:27 AM6/23/16
to Robert Mitwicki, Repo and Gerrit Discussion
On Thu, Jun 23, 2016 at 10:10 AM, Robert Mitwicki <mit...@gmail.com> wrote:
Hi all,

I would like to ask few question regarding the reindex feature (offline and online).
Just to give you a context:

I wanted to rename one of the project on gerrit. So basically I fallowed one of the tutorial which I found on this mailing list.
The problem is that for some reason (to those who are curious I forgot to press commit in Oracle - yep) I did not perform changes in the database before starting reindexing.

So basically it should go like this:

UPDATE CHANGES set DEST_PROJECT_NAME='projA' where DEST_PROJECT_NAME='projB';
update ACCOUNT_PROJECT_WATCHES SET PROJECT_NAME = 'projA' where PROJECT_NAME = 'projB';

and the do the reindexing. But as I already mentioned I forgot to commit those changes so the database didn't changed.
I renamed git repository on the file system.

So after few hours of reindexing (offline reindexing) system was back online but the problem is that non of the change from 'projB/projA' was visible in the gerrit (If I knew the change id I could open it but could not search for it nor see it on dashboard).
I thought that I will just change the database (this time press the commit :) ) and do the online reindexing (gerrit v 2.11.4) as I didn't wanted to block developers this time.

The problem is that as soon as I will try to do it:

ssh gerrit-host gerrit index start

and I am getting:
Nothing to reindex, index is already the latest version

Items are still not available on the dashboards nor over search.
Just to mention that as soon as I will touch one of the change (like leave a commend, add reviewer) it will appear back on the dashboard (The index is refreshed? )

And here are the questions:
Is there a way to force online reindexing - skip this check?

You can index changes one by one using REST API [1].
Query your database for a list of all (numerical) change-ids then, as an example, use curl:

$ curl -k -n -X POST http(s)://server:port/a/changes/<id>/index

the -k is only necessary if you use https and want to skip SSL cert verification.
the -n reads your user/pass from $HOME/.netrc


Is there a way to limit reindexing (offline/online) just to one project?
If I will change the number in gerrit_index.config to a lower one will this help somehow (like allow me to run it)?
Since the database didn't change why the reindex happend? Why it took so long (over few hours) - could be that the index was low because someone forgot to reindex database after one of the upgrade?


Thanks a lot for explanation.
Best regards
Robert

--
--
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/d/optout.

Message has been deleted
Message has been deleted

Michelle Pogado

unread,
Aug 20, 2018, 5:25:02 AM8/20/18
to Repo and Gerrit Discussion
Hello, 


I have a related question.


A projectX has been replicated to our gerrit instance.

Then I made a new commit, submitted as change 1261, to this replicated projectX and the change was merged successfully.

After some time, another member cloned projectX but the git log does not show my new commit.
Change 1261 is still accessible via the Gerrit UI.

I tried reindexing via the rest API but I get 
[user@gerrit]$ curl --request POST -I --user username http://gerrit.com:8080/a/changes/1261/index
Enter host password for user 'username':
HTTP/1.1 204 No Content
Date: Mon, 20 Aug 2018 08:46:14 GMT
Content-Disposition: attachment
X-Content-Type-Options: nosniff
Cache-Control: no-cache, no-store, max-age=0, must-revalidate
Pragma: no-cache
Expires: Mon, 01 Jan 1990 00:00:00 GMT


Also, when I checked the actual change
[user@gerrit]$ ll /data/gerrit/home/git/projectX.git/refs/changes/61/1261/
total 0


Question:
- If the source gerrit instance will be restarted, will the replication of projectX be restarted?
  Thus, losing the association to my new commit - change 1261?
- Will reindexing resolve the changes using the refs/changes/61/1261/meta?
- What could be the explanation for this?



Thanks!
Reply all
Reply to author
Forward
0 new messages