-
Type:
Bug
-
Resolution: Fixed
-
Priority:
Low
-
Affects Version/s: 9.12.13
-
Component/s: Data Center - Index
-
9.12
-
11
-
Severity 3 - Minor
-
1
-
Issue Summary
During the index restore process, Jira will obtain an exclusive write lock, which means that no other read or update operations can be performed on the index. Jira still handles traffic during the restore process however, which causes update operations to timeout.
Worse, because entity version isn't being updated, these update operations performed during the restore process won't be replicated to the other nodes, even after the index restore process completes.
This is reproducible on Data Center: Yes
Steps to Reproduce
- Create a 2 node JDC cluster
- On node1, connect a JVM debugger.
- Place a thread-specific breakpoint on something within the index recovery/catch-up process (such as com.atlassian.jira.index.ha.DefaultIndexRecoveryManager.ReplaceIndexRunner#catchUp).
- One node2, initiate a full reindex and wait for it to complete.
- Wait for the breakpoint to hit due to the FULL_REINDEX_END cluster message.
- Observe that you can still access the UI, although it will be extremely laggy.
Expected Results
Access to Jira is blocked while the index snapshot is being restored ( this occurs correctly when using 1 node without clustering enabled )
Actual Results
Jira is accessible
The below exception is thrown in the atlassian-jira.log file:
2024-09-27 02:32:24,925+0000 http-nio-8080-exec-2 url: /jira/secure/WorkflowUIDispatcher.jspa; user: admin ERROR admin 151x523x1 18ejmbe 172.29.254.120,172.50.0.3 /secure/WorkflowUIDispatcher.jspa [c.a.j.issue.index.DefaultIndexManager] Wait attempt timed out - waited 30000 milliseconds com.atlassian.jira.issue.index.IndexException: Wait attempt timed out - waited 30000 milliseconds 2024-09-27 02:32:24,928+0000 http-nio-8080-exec-2 url: /jira/secure/WorkflowUIDispatcher.jspa; user: admin ERROR admin 151x523x1 18ejmbe 172.29.254.120,172.50.0.3 /secure/WorkflowUIDispatcher.jspa [c.a.j.issue.index.DefaultIndexManager] Could not reindex: com.atlassian.jira.issue.util.IssueObjectIssuesIterable (1 items): [SCRUM-1] com.atlassian.jira.issue.index.exception.CannotGetIndexLockException: Can not get index lock.
Workaround
The following bash script will identify affected issues from the error logs and re-index them over the REST API
#!/bin/bash # Run in Jira log directory or copy atlassian-jira.log files to the current working directory # Extract unique Jira issue keys issue_keys=$(grep 'Could not reindex: com.atlassian.jira.issue.util.IssueObjectIssuesIterable' atlassian-jira.log* | grep -o '\[[A-Z][A-Z0-9]*-[0-9]\+\]' | sed 's/\[\(.*\)\]/\1/' | sort | uniq ) # Base URL without trailing / ( ex: https://jira.example.com ) base_url="(bseurl)" # Personal access token token="(token)" # Loop through each unique issue key and make a curl request for issue_key in $issue_keys; do echo "Reindexing issue: $issue_key" curl -H "Authorization: Bearer $token" -X POST "${base_url}/rest/api/2/reindex/issue?issueId=${issue_key}" echo -e "\n" done