2021-09-21: global search sidekiq queues are not draining
Current Status
The Advanced Search migration add_upvotes_mappings_to_merge_requests
was marked as halted
and not completed
to prevent indexing upvotes
for merge request documents.
More information will be added as we investigate the issue.
Timeline
2021-09-15
-
12:00
- sidekiq queues began to back up for Global search incremental indexing and Global search initial indexing2021-09-21
-
18:23
- incident declared -
18:26
- graphana confirms that queues are backed up -
18:49
- confirmed in Kibana that the Elasticsearch indexes are not seeing indexing traffic -
18:57
- I see no indexing activity on the issues, merge_requests, and notes indexes and reduced activity on the production index. Some background: We have 4 indexes for GitLab.com search - production, issues, merge_requests, and notes. The production index is the original index but we've been working to split it out so there are separate indexes per data type. The production index currently contains milestones, blobs, wiki-blobs, commits, projects. -
18:58
- foundElasticIndexInitialBulkCronWorker
started failing around the same time as the sidekiq queue backup started (https://log.gprd.gitlab.net/app/discover#/doc/AWNABDRwNDuQHTm2tH6l/pubsub-sidekiq-inf-gprd-001871?id=K_K5CXwBj_40Y_mDnl61) -
19:01
- seeing ActiveRecord::QueryCanceled (PG::QueryCanceled: ERROR: canceling statement due to statement timeout) on production (sentry: https://sentry.gitlab.net/gitlab/gitlabcom/issues/2804508/?query=is%3Aunresolved%20elastic) -
19:30
- Dmitry noticed in the production console that the error is related to query timeout for AwardEmoji. That was recently added to the merge request documents in Elasticsearch and only filled out if the Advanced Search migrationadd_upvotes_mappings_to_merge_requests
is completed -
19:32
- Decided on a mitigation to set the migration state tohalted
=true
andcompleted
=false
, this was done through the rails console
migration = Elastic::DataMigrationService.find_by_name(:add_upvotes_mappings_to_merge_requests)
migration.halt!
migration.save!(completed: false)
We also had to drop the migration cache
Elastic::DataMigrationService.drop_migration_halted_cache!(migration)
Elastic::DataMigrationService.drop_migration_has_finished_cache!(migration)
Confirm the changes
Elastic::DataMigrationService.migration_has_finished?(:add_upvotes_mappings_to_merge_requests)
migration.halted?
-
19:34
- we do have an alert for the queue size: gitlab-org/gitlab#321860 (closed) -
19:45
-add_upvotes_mappings_to_merge_requests
Advanced Search migration marked as halted and not completed to preventupvotes
from being included in indexed documents -
20:17
- confirm that queues continue to drain
Recent Events (available internally only):
All times UTC.
2021-09-21
-
18:23
- @terrichu declares incident in Slack.
Corrective Actions
Corrective actions should be put here as soon as an incident is mitigated, ensure that all corrective actions mentioned in the notes below are included.
- Global Search team follow up to work with infrastructure on being alerted when the alerts fire: gitlab-org/search-team/team-tasks#49 (closed)
-
Global Search team to fix the problematic query and add pick into %14.3 label: gitlab-org/gitlab#341433 (closed) - Revert original MR gitlab-org/gitlab!70944 (merged)
- Once the
fixrevert MR from the above issue is deployed, we will open an infrastructure change issue to:- Mark the Advanced Search
add_upvotes_mappings_to_merge_requests
migration as completed - Mark the Advanced Search
add_upvotes_mappings_to_merge_requests
migration as not halted - Monitor the indexing processes to verify no errors or database timeouts are occurring
- Monitor the sidekiq queues to ensure they are draining normally
- Mark the Advanced Search
- Identify whether we can reintroduce the original migration/change, I suspect we may not be able to do this work at the time because of database performance concerns while guaranteeing that we can index 16,000 records within 1 minute to Elasticsearch.
Note: In some cases we need to redact information from public view. We only do this in a limited number of documented cases. This might include the summary, timeline or any other bits of information, laid out in out handbook page. Any of this confidential data will be in a linked issue, only visible internally. By default, all information we can share, will be public, in accordance to our transparency value.
Click to expand or collapse the Incident Review section.
Incident Review
-
Ensure that the exec summary is completed at the top of the incident issue, the timeline is updated and relevant graphs are included in the summary -
If there are any corrective action items mentioned in the notes on the incident, ensure they are listed in the "Corrective Action" section -
Fill out relevant sections below or link to the meeting review notes that cover these topics
Customer Impact
-
Who was impacted by this incident? (i.e. external customers, internal customers)
- ...
-
What was the customer experience during the incident? (i.e. preventing them from doing X, incorrect display of Y, ...)
- ...
-
How many customers were affected?
- ...
-
If a precise customer impact number is unknown, what is the estimated impact (number and ratio of failed requests, amount of traffic drop, ...)?
- ...
What were the root causes?
- ...
Incident Response Analysis
-
How was the incident detected?
- ...
-
How could detection time be improved?
- ...
-
How was the root cause diagnosed?
- ...
-
How could time to diagnosis be improved?
- ...
-
How did we reach the point where we knew how to mitigate the impact?
- ...
-
How could time to mitigation be improved?
- ...
-
What went well?
- ...
Post Incident Analysis
-
Did we have other events in the past with the same root cause?
- ...
-
Do we have existing backlog items that would've prevented or greatly reduced the impact of this incident?
- ...
-
Was this incident triggered by a change (deployment of code or change to infrastructure)? If yes, link the issue.
- ...
Lessons Learned
- ...
Guidelines
Resources
- If the Situation Zoom room was utilised, recording will be automatically uploaded to Incident room Google Drive folder (private)