On Friday, December 17, 2021 at 3:43:03 PM UTC+1 zheng...@gmail.com wrote:once user queris on merged changes withou any other filters , gerrit will cost a lot of time to return and a lot of CPU resources.when this happened, i checkout the debug log and found the query read almost all repos' changes although the user do not have the access right. also a item in Queue:Index-Interfactive displayed according. If I clicked multiple time of Changes->Merged menu, the Queue:Index-Interfactive items accumulated as well and gerrit cost all CPU resources and we must restart gerrit.any idea will be appreciated!An educated guess is that you have updated not to long ago and used "online reindex" (i.e. you did not take Gerrit down to do an offline reindex) (I'm guessing the online reindex is involved, I have no actual proof).
Then Gerrit will reindex changes in the background or when necessary in same transaction as the query if the query hits "stale" changes.
I'm not well versed enough in the ins and outs of the index to give you a precise root cause but I have seen similar behavior when f.i. querying for every commit on a branch. Gerrit will encounter changes that it considers needs a reindex and reindex them in the same transaction as the query.
Sven, many thanks for your advice.Same guess at the beginning. but it can still reproduce after I replicated prod data into testing env && re-index all data offline.


after upgrade to 3.4.1, the problem is still existing. The steps to reproduce the problem as below,
1. login with a userid which has only 2 repos access right( 1.5k repos totally)
2. click Merge menu 3 times to run in new tab pagesit showed that
1. 3 items in Queue:Index-Interactive with very long time execution
2. CPU utilization is very highhow to fix this problem or it runs as design?