My JIRA index is newer than database - how to fix?

Chad@ Norwood October 30, 2017

My jira failed a health check, and says the following under "Indexing Lucene" on this page: JIRA.EXAMPLE.COM/plugins/servlet/troubleshooting/view/?source=notification

"The issue index is inconsistent with the database state. The last issue update recorded in the database was at (10/27/17 9:10 AM) but the last issue update recorded in the index was at (10/30/17 11:59 AM).

In other words, the database has old data, the Lucene index has newer data.

Note this was probably a result of database port being blocked.

How do i force database to update from jira index?

I have jira 7.5.1 and postgres 9.4 all running on linux, one host.

 

3 answers

1 accepted

2 votes
Answer accepted
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 1, 2017

There is no process to take index data and move it to the database.  Database data and Index data is not a two-way street, so to speak.   The indexes are created solely upon the content in the database.

When you update/create issues in Jira, the database is actually being updated first, and then Jira is triggering an incremental index update to grab that new value and add it to your existing indexes.   Jira does not source data from the indexes to be then placed into the database.

It is unusual that the indexes would state their update is newer than the database, I grant you that.  Usually when we see this health check warning in support, it is the other way around, with the indexes being significantly older than the database.  Which usually indicates that the indexes are corrupted and in turn have to be rebuilt from scratch.  

Since you mentioned there was a blocked port to the database, I think it more than reasonable that the healthcheck Jira is running was simply unable to update this value which in turn is generating this error.

I am curious to see if perhaps just restarting Jira can kickstart this healthcheck into being able to reestablish this check correctly once more.  If that doesn't work, then recreating the indexes is another valid means to troubleshoot this as Alexey suggested.   I wouldn't expect this problem to happen again, unless there is something preventing Jira from reaching that database periodically.

2 votes
Alexey Matveev
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
October 30, 2017

Hello, 

You need to reindex Jira. More about reindexing you can read here

https://confluence.atlassian.com/adminjiraserver071/search-indexing-802593000.html

Chad@ Norwood October 30, 2017

Re-indexing copies from database to Lucene, which erases all information in index.

I wanted to copy from index to database.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 30, 2017

There is no process to take index data and move it to the database.  Database data and Index data is not a two-way street, so to speak.   The indexes are created solely upon the content in the database.

When you update/create issues in Jira, the database is actually being updated first, and then Jira is triggering an incremental index update to grab that new value and add it to your existing indexes.   Jira does not source data from the indexes to be then placed into the database.

It is unusual that the indexes would state their update is newer than the database, I grant you that.  Usually when we see this health check warning in support, it is the other way around, with the indexes being significantly older than the database.  Which usually indicates that the indexes are corrupted and in turn have to be rebuilt from scratch.  

Since you mentioned there was a blocked port to the database, I think it more than reasonable that the healthcheck Jira is running was simply unable to update this value which in turn is generating this error.

I am curious to see if perhaps just restarting Jira can kickstart this healthcheck into being able to reestablish this check correctly once more.  If that doesn't work, then recreating the indexes is another valid means to troubleshoot this as Alexey suggested.   I wouldn't expect this problem to happen again, unless there is something preventing Jira from reaching that database periodically.

Chad@ Norwood November 1, 2017

Thanks Andrew - your comment is the best "solution".

I resolved to lose my changes that weren't in database by doing a reindex (which i've done hundreds of times).  That still created a problem since the index had more issues than the db, but after jira reboot there were no more problems reported by jira.

Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
November 1, 2017

HI Chad,

Thanks for letting me know.  I will re-post my previous reply as an answer and accept it in case other users encounter this same kind of problem.

Regards,
Andy

0 votes
Brian Jones
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
October 30, 2017

Are you running on the same machine? If not, make sure you have NTP running and they are pointed at the same time source. That could be a cause.

Chad@ Norwood October 30, 2017

For others this is something to consider, but not applicable in my case.

Suggest an answer

Log in or Sign up to answer