VERSION 4.23 NEW FEATURE
Introduction
Reindexing may take a very long time to complete due to some reasons such as handling very large repositories, indexing issues, or very low system resources. This feature is introduced to allow Jira administrators to interrupt an indexing process once it has been queued or has already started.
The index data remains as is at the moment of cancellation of the reindex task.
The Cancel action interrupts:
- a revision indexing phase of a repository reindex
- a scanning phase of an integration reindex
- a tags topology calculation
It does not cover the following cases, such as a cancellation of:
- Garbage Collection tasks
- Remove repository tasks
- Garbage Collection All tasks
- Pull/merge requests indexing phase
- Delete operation tasks1
1 Currently, the cancel action for any delete operation tasks in the queue is not supported.
Highlights
There are three (3) ways a reindex can be interrupted by performing the following methods:
-
Indexing queue viewer ➜ … (Actions) ➜ Cancel reindex context-menu VERSION 4.23
This marks the reindexing task as CANCELED. It’s like a suspended task and it can be resumed later on with a manual reindex.
-
Manage repositories ➜ Actions ➜ disable a repository/integration.
This does not interrupt a reindex thread but skip it instead. Subsequent reindex will resume the indexing process.
Starting v4.23+, disabling a repository/integration behaves in the same way as the Cancel action from the Indexing queue viewer page.
-
Disable the Git Integration for Jira app in the Jira Manage apps page. This will absolutely interrupt the reindex thread.
Access location
The Cancel indexing task can be only accessed at the following location:
-
Indexing queue viewer ➜ … (actions) ➜ Cancel (context menu)
CANCELED status
A new CANCELED status is available to the indexing queue task state. Additionally, the Cancel function is implemented to the Actions (…) menu on the Indexing queue viewer page. The indexed data remains as is at the moment of cancellation of the reindex task. Likely, subsequent reindex will just fix them along the way.
The CANCELED status is also implemented in the Manage repositories configuration list.
Jira administrators can resume the CANCELED status via Actions ➜ Reindex repository/integration.
How does canceling affect the initial reindex?
The initial reindex happens after a repository/integration is connected and when it is the very first reindex of a repository/integration, where:
- Smart commits processing is skipped on initial reindex
- Automation for Jira triggers are not triggered
- Any script execution due to initial indexing are ignored
- The
lastUpdated
field on the initial reindex is not updated.
If the initial reindex is canceled, the Git Integration for Jira indexing engine will remember that the initial reindex hasn’t been finished yet. You’ll also notice that Git Commits tab, Git Roll Up tab and Git Integration developer panel on the Jira Issue page does not contain git data because the git connection is in an ‘unfinished’ state. We recommend that the initial reindex is not interrupted.
How long does reindex take?
Reindex usually completes in several seconds to a couple of hours or maybe more depending on the factors stated below.
-
how powerful is the host hardware
-
how large is the repository, based on:
-
the average number of commits in a branch (see below)
-
the number of branches
-
the number of pull/merge requests
-
the number of tags
-
the amount of large files
-
-
the amount of remaining system resources
-
(Gerrit) how many nested repositories are there
-
(Tracked folders) how many nested folders (repositories) are there
-
(Data Centers) how many nodes are there
How does canceling reindex affect queued Data Center nodes?
A reindex of the task is canceled on ALL Jira nodes.
How to know the average number of commits in a branch?
If your main branch is “master”, then the next command call from the root of your repository clone will return the average number:
git branch -r | xargs -i git rev-list --count {} ^master | grep -v 0 | awk 'BEGIN{s=0;}{s+=$1;}END{print s/NR;}'
If the value is greater than 1000, it will impact the indexing performance.
The following command will return number of commits , which will be reindexed on an initial reindex:
git branch -r | xargs -i git rev-list --count {} ^master | grep -v 0 | awk 'BEGIN{s=0;}{s+=$1;}END{print s;}'
See more Git Integration for Jira app features
Manager permissions (Git Integration for Jira Data Center)
Cancel indexing (this page)
Pull request filters (Git Integration for Jira Data Center)
Tag filters (Git Integration for Jira Data Center)
Indexing queue viewer (Git Integration for Jira Data Center)
Deep linking feature (Git Integration for Jira Data Center)
GitHub App integration (Git Integration for Jira Data Center)
Git Integration + ScriptRunner (Git Integration for Jira Data Center)
Git Integration + Jira Automation (Git Integration for Jira Data Center)
Enforced git permissions for Jira users – Features (Git Integration for Jira Data Center)
Shared reindex queue between DC nodes (Git Integration for Jira Data Center)
Smart commits overview (Git Integration for Jira Data Center)
Associate Pull/Merge Requests to Issues Based on Commits (Git Integration for Jira Data Center)
Creating branches (Git Integration for Jira Data Center)
Creating pull/merge requests (Git Integration for Jira Data Center)
Issue Git integration panel – Features (Git Integration for Jira Data Center)