Issue 2674: change appears in 'open' and 'closed' index at the same time.
Status:  New
Owner: ----
Cc:
Reported by sven.sel...@sonymobile.com, May 21, 2014
Affected Version: 2.8.x

What steps will reproduce the problem?
1. Submit a change(The frequency of this bug is very low, haven't found a way to reproduce it yet.)

What is the expected output?
I expect the change to display in the UI with status 'merged' or 'submitted'.
What do you see instead?
The change appears with both statuses 'merged' and 'submitted':
query: change:<change id> 
Displays two instances of the same change.

query: change:<change id>+status:merged
query: change:<change id>+status:submitted
Both display one instance of the change.

Please provide any additional information below.

Investigating the index with Luke confirms that change is in both 'closed' and 'open' index.
The change is merged, and the git looks ok.
The change has status 'merged' in DB.

My first thought was that the problem lies in
(line 239 v2.8.5) LuceneChangeIndex.insert(ChangeData cd)
It might be that the call to:
(line 249 v2.8.5) openIndex.delete(id);
Silently fails, or the Term "id" is somehow corrupt and does not identify the change in the index.
I have not been able to confirm my suspicion.

/Sven
May 26, 2014
Project Member #1 bruce.zu@sonymobile.com
provide a related error log:

 
[2014-05-26 08:54:24,021] ERROR com.google.gerrit.server.index.ChangeIndexerImpl : Failed to index change 855760 in <project name>
java.io.IOException: java.lang.InterruptedException
        at com.google.gerrit.lucene.LuceneChangeIndex.replace(LuceneChangeIndex.java:277)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.apply(ChangeIndexerImpl.java:154)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.call(ChangeIndexerImpl.java:129)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.call(ChangeIndexerImpl.java:89)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132)
        at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58)
        at com.google.gerrit.server.index.ChangeIndexer.submit(ChangeIndexer.java:189)
        at com.google.gerrit.server.index.ChangeIndexer.indexAsync(ChangeIndexer.java:97)
        at com.google.gerrit.server.index.ChangeIndexer.indexAsync(ChangeIndexer.java:87)
        at com.google.gerrit.server.change.PostReview.apply(PostReview.java:192)
        at com.google.gerrit.sshd.commands.ReviewCommand.applyReview(ReviewCommand.java:217)
        at com.google.gerrit.sshd.commands.ReviewCommand.approveOne(ReviewCommand.java:276)
        at com.google.gerrit.sshd.commands.ReviewCommand.run(ReviewCommand.java:194)
        at com.google.gerrit.sshd.SshCommand$1.run(SshCommand.java:35)
        at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:442)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1301)
        at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:285)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
        at com.google.gerrit.lucene.LuceneChangeIndex.replace(LuceneChangeIndex.java:266)
        ... 24 more
[2014-05-26 08:54:24,029] ERROR com.google.gerrit.sshd.commands.ReviewCommand : internal error while approving 855760,2
java.io.IOException: java.lang.InterruptedException
        at com.google.gerrit.lucene.LuceneChangeIndex.replace(LuceneChangeIndex.java:277)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.apply(ChangeIndexerImpl.java:154)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.call(ChangeIndexerImpl.java:129)
        at com.google.gerrit.server.index.ChangeIndexerImpl$Task.call(ChangeIndexerImpl.java:89)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at com.google.common.util.concurrent.MoreExecutors$SameThreadExecutorService.execute(MoreExecutors.java:297)
        at java.util.concurrent.AbstractExecutorService.submit(AbstractExecutorService.java:132)
        at com.google.common.util.concurrent.AbstractListeningExecutorService.submit(AbstractListeningExecutorService.java:58)
        at com.google.gerrit.server.index.ChangeIndexer.submit(ChangeIndexer.java:189)
        at com.google.gerrit.server.index.ChangeIndexer.indexAsync(ChangeIndexer.java:97)
        at com.google.gerrit.server.index.ChangeIndexer.indexAsync(ChangeIndexer.java:87)
        at com.google.gerrit.server.change.PostReview.apply(PostReview.java:192)
        at com.google.gerrit.sshd.commands.ReviewCommand.applyReview(ReviewCommand.java:217)
        at com.google.gerrit.sshd.commands.ReviewCommand.approveOne(ReviewCommand.java:276)
        at com.google.gerrit.sshd.commands.ReviewCommand.run(ReviewCommand.java:194)
        at com.google.gerrit.sshd.SshCommand$1.run(SshCommand.java:35)
        at com.google.gerrit.sshd.BaseCommand$TaskThunk.run(BaseCommand.java:442)
        at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
        at java.util.concurrent.FutureTask.run(FutureTask.java:262)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:178)
        at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:292)
        at com.google.gerrit.server.git.WorkQueue$Task.run(WorkQueue.java:364)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:724)
Caused by: java.lang.InterruptedException
        at java.util.concurrent.locks.AbstractQueuedSynchronizer.acquireSharedInterruptibly(AbstractQueuedSynchronizer.java:1301)
        at com.google.common.util.concurrent.AbstractFuture$Sync.get(AbstractFuture.java:285)
        at com.google.common.util.concurrent.AbstractFuture.get(AbstractFuture.java:116)
        at com.google.gerrit.lucene.LuceneChangeIndex.replace(LuceneChangeIndex.java:266)
        ... 24 more


May 26, 2014
Project Member #2 bruce.zu@sonymobile.com
Dave Borowitz
Cc: dborowitz@google.com