• Our product teams collect and evaluate feedback from a number of different sources. To learn more about how we use customer feedback in the planning process, check out our new feature policy.

      NOTE: This suggestion is for JIRA Cloud. Using JIRA Server? See the corresponding suggestion.

      On systems with many issues, a reindex (triggered manually or during an upgrade) implies a potentially large period of downtime. Couldn't JIRA simply build the new index in parallel, and swap it in for the live one when the index is created?

            [JRACLOUD-7842] Reindex in background to avoid locking users out

            David Corley added a comment - @Leigh, Mark has commented on the implementation details in a separate Jira here: https://jira.atlassian.com/browse/JRA-25788?focusedCommentId=323761&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-323761 Hope this helps.

            I've not had a chance to try out 5.2 EAP as yet, but can anyone confirm if this has been implemented in that release and provide some details as to the mechanism that's been adopted?

            Thanks

            Leigh Grealis added a comment - I've not had a chance to try out 5.2 EAP as yet, but can anyone confirm if this has been implemented in that release and provide some details as to the mechanism that's been adopted? Thanks

            This will be implemented in 5.2 - the first milestone will be available for testing and feedback in ~ 2 weeks.

            Mark Lassau (Inactive) added a comment - This will be implemented in 5.2 - the first milestone will be available for testing and feedback in ~ 2 weeks.

            This is a feature I would expect from any application advertising itself as "Enterprise". You simply cannot have operations that lock users out, especially routine maintenance operations.

            JIRA should re-index in the background, but, if that's not possible, it should at a minimum re-index atomically by project to lessen the global impact.

            Ashton Treadway added a comment - This is a feature I would expect from any application advertising itself as "Enterprise". You simply cannot have operations that lock users out, especially routine maintenance operations. JIRA should re-index in the background, but, if that's not possible, it should at a minimum re-index atomically by project to lessen the global impact.

            Chris Kent added a comment -

            Hi, I implemented Michael's Jelly script below and works a treat, does background re-indexing and still allows users to access JIRA issues at the same time, however it does not remove the blue banner in Admin mode saying the a re-index is needed?

            Chris Kent made configuration changes in section 'Custom Fields' at 03/May/12 11:31 AM. It is recommended that you perform a re-index. For more information, please click the Help icon.

            To perform the re-index now, please go to the 'Indexing' section.

            Note: So that you only have to re-index once, you may wish to complete any other configuration changes before performing the re-index.

            My question is, what command can I add to the Jelly script to remove this warning banner after the background re-index is finished?

            Thanks

            Chris Kent added a comment - Hi, I implemented Michael's Jelly script below and works a treat, does background re-indexing and still allows users to access JIRA issues at the same time, however it does not remove the blue banner in Admin mode saying the a re-index is needed? Chris Kent made configuration changes in section 'Custom Fields' at 03/May/12 11:31 AM. It is recommended that you perform a re-index. For more information, please click the Help icon. To perform the re-index now, please go to the 'Indexing' section. Note: So that you only have to re-index once, you may wish to complete any other configuration changes before performing the re-index. My question is, what command can I add to the Jelly script to remove this warning banner after the background re-index is finished? Thanks

            MattS added a comment -

            The jelly script is iterating over a set of issues, calling reIndex on wach one. The usual reindex operation does the iteration from within Java so I'd expect it to be (a bit) faster.

            MattS added a comment - The jelly script is iterating over a set of issues, calling reIndex on wach one. The usual reindex operation does the iteration from within Java so I'd expect it to be (a bit) faster.

            Ivar Ekman added a comment -

            @Michael, we have not shared this implementation. Do not hesitate to contact me per e-mail for more information. It is a custom Java solution that has its own db and runs separate from Jira, hence keeps Jira running smooth. I prefer to archive projects as separate time-boxed projects in Jira but in some cases this is not possible.

            Ivar Ekman added a comment - @Michael, we have not shared this implementation. Do not hesitate to contact me per e-mail for more information. It is a custom Java solution that has its own db and runs separate from Jira, hence keeps Jira running smooth. I prefer to archive projects as separate time-boxed projects in Jira but in some cases this is not possible.

            @Matt: The jelly-script shouldn't be faster or slower. It just starts the normal reindex process with the issues provided by the given filter.

            @Ivar: how do you implemented your archiving solution? Is it available as plugin?

            Michael Stelzner [Communardo] added a comment - @Matt: The jelly-script shouldn't be faster or slower. It just starts the normal reindex process with the issues provided by the given filter. @Ivar: how do you implemented your archiving solution? Is it available as plugin?

            Ivar Ekman added a comment -

            With 500k+ issues and hardware designed to run Jira smoothly but without exaggerating the server specs it took us over 5 hours to do the reindexing in Jira 3.13. After this, we implemented a custom archiving solution to cut down on the number of old rarely needed issues.

            Ivar Ekman added a comment - With 500k+ issues and hardware designed to run Jira smoothly but without exaggerating the server specs it took us over 5 hours to do the reindexing in Jira 3.13. After this, we implemented a custom archiving solution to cut down on the number of old rarely needed issues.

            MattS added a comment -

            Reindex on a server with enough memory shouldn't take hours. I see 10 mins to 180K issues at one client. I'd be interested to know how much longer than the ordinary reindex using Jelly takes?

            MattS added a comment - Reindex on a server with enough memory shouldn't take hours. I see 10 mins to 180K issues at one client. I'd be interested to know how much longer than the ordinary reindex using Jelly takes?

            A small jelly-script which reindex all issues of a filter in the background:

             
            <JiraJelly xmlns:jira="jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core="jelly:core" >
              <!-- Properties for the script -->
              <core:set var="filterID" value="<!-- filter-id e.g. 17941 -->" />
            
              <!-- Run the SearchRequestFilter -->
              <jira:RunSearchRequest filterid="${filterID}" var="issues" />
              <core:invokeStatic className="com.atlassian.jira.ManagerFactory" method="getIndexManager" var="indexManager"/>
            
              <!-- Iterate over the issues -->
              <core:forEach var="issue" items="${issues}">
                <core:invoke on="${indexManager}" method="reIndex">
                  <core:arg type="org.ofbiz.core.entity.GenericValue" value="${issue}"/>
                </core:invoke>
              </core:forEach>
            </JiraJelly>
            

            Michael Stelzner [Communardo] added a comment - A small jelly-script which reindex all issues of a filter in the background: <JiraJelly xmlns:jira = "jelly:com.atlassian.jira.jelly.enterprise.JiraTagLib" xmlns:core = "jelly:core" > <!-- Properties for the script --> <core:set var= "filterID" value= " <!-- filter-id e.g. 17941 --> " /> <!-- Run the SearchRequestFilter --> <jira:RunSearchRequest filterid= "${filterID}" var= "issues" /> <core:invokeStatic className= "com.atlassian.jira.ManagerFactory" method= "getIndexManager" var= "indexManager" /> <!-- Iterate over the issues --> <core:forEach var= "issue" items= "${issues}" > <core:invoke on= "${indexManager}" method= "reIndex" > <core:arg type= "org.ofbiz.core.entity.GenericValue" value= "${issue}" /> </core:invoke> </core:forEach> </JiraJelly>

            We've used Jira for years for all kinds of things, and have tens of thousands of tickets. It therefore takes a couple of hours for the reindex process to run. It is not acceptable to have the system be unavailable for that length of time. We've also had at least two experiences of someone kicking off the reindex inadvertantly, locking out the users during the middle of the day. There should be a Cancel option, and a scary "Are you Sure?" message.

            Dave Drexler added a comment - We've used Jira for years for all kinds of things, and have tens of thousands of tickets. It therefore takes a couple of hours for the reindex process to run. It is not acceptable to have the system be unavailable for that length of time. We've also had at least two experiences of someone kicking off the reindex inadvertantly, locking out the users during the middle of the day. There should be a Cancel option, and a scary "Are you Sure?" message.

            kpetrov added a comment -

            sorry, wrong attachment. Please delete it.

            kpetrov added a comment - sorry, wrong attachment. Please delete it.

            Jeff Kirby added a comment -

            Kaarel, I'd really like to try your plugin out and would like to know more about it's architecture. I tried the link above but I get an error message about groovy and grails when I open it.
            In what environments have you tested the plugin? I would be nervous to use it unless it's guaranteed that there will be no index loss under our usual load with our hundreds of thousands of bugs.
            I too tried to write a plugin to perform a full, live re-index. It looked like mine worked but a few hours hours we discovered issues that were no longer indexed at all.

            Jeff Kirby added a comment - Kaarel, I'd really like to try your plugin out and would like to know more about it's architecture. I tried the link above but I get an error message about groovy and grails when I open it. In what environments have you tested the plugin? I would be nervous to use it unless it's guaranteed that there will be no index loss under our usual load with our hundreds of thousands of bugs. I too tried to write a plugin to perform a full, live re-index. It looked like mine worked but a few hours hours we discovered issues that were no longer indexed at all.

            Hi
            We developed a plugin that can do full or partial background re-indexing without any downtimes.
            https://plugins.atlassian.com/plugin/details/44395

            Kaarel Lumi added a comment - Hi We developed a plugin that can do full or partial background re-indexing without any downtimes. https://plugins.atlassian.com/plugin/details/44395

            Ryan Steed added a comment -

            This is becoming more critical as we continue to grow and retain data. Please implement this ASAP.

            Thanks

            Ryan Steed added a comment - This is becoming more critical as we continue to grow and retain data. Please implement this ASAP. Thanks

              tcampbell Trevor Campbell (Inactive)
              7ee5c68a815f Jeff Turner
              Votes:
              51 Vote for this issue
              Watchers:
              36 Start watching this issue

                Created:
                Updated:
                Resolved: