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

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

1 vote

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 Community Champion Oct 30, 2017

Hello, 

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

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

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

I wanted to copy from index to database.

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.

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.

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 vote
Brian Jones Community Champion Oct 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.

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

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Sarah Schuster
Posted Mar 28, 2018 in Jira Software

Can a company’s culture make or break agile adoption?

Can a new-to-agile team survive and thrive in a non-agile culture? If so, what advice would you give to those trying to be agile in a non-agile culture? What's the key(s) to success? Share your thoug...

11,903 views 14 13
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you