2022-03-15: Missing objects in gitlab-org/gitlab

Incident DRI

@pks-t

Current Status

Users have started to report that they get errors about missing objects in gitlab-org/gitlab. Starting at 12:30 UTC we also see a steady rate of Internal errors for that repository with object not found error messages. This coincides with a rollout of gitlab-org/gitlab#353607 (closed), which moves repository maintenance tasks to use OptimizeRepository.

It was found that errors started to occur exactly after the first call to OptimizeRepository has finished to be processed. Digging into the implementation of that repository surfaced a bug in how git-prune(1) was called such that it accidentally deleted unreachable objects without any grace period. This created a race between writing objects to disk and updating references to point to those new objects in concurrent RPC calls: if the race was lost, then git-prune(1) would have deleted all new objects before the reference could be updated, with the end result being that the reference points to a now-missing objects.

The bug is not a new one: it has existed for multiple weeks. In the past though the code was only hit during nightly maintenance, where the load is significantly lower. As a result, the likelihood that above race was lost was significantly lower. With the new infrastructure we also called OptimizeRepository at peak times, which conversely raised the chances to hit this race.

The bug was fixed via gitlab-org/gitaly!4410 (merged) and rolled out to production on 2022-03-17, 14:40 UTC.

The repository had three references part of the same merge request. These references were deleted, which returned error levels for that repository back to normal. Most importantly, we didn't see any indication of repository corruption anymore.

Summary for CMOC notice / Exec summary:

  1. Customer Impact: Only gitlab-org/gitlab is impacted.
  2. Service Impact: Gitaly
  3. Impact Duration: 12:30 UTC - 13:30 UTC (2910 minutes)
  4. Root cause: Repository optimizations accidentally pruned unreachable objects without a grace period, which uncovered a race between writing objects to disk and making them reachable via a reference update. If the race was lost, then the updated references would now point to missing objects.

Timeline

Recent Events (available internally only):

  • Deployments
  • Feature Flag Changes
  • Infrastructure Configurations
  • GCP Events (e.g. host failure)
  • Gitlab.com Latest Updates

All times UTC.

2022-03-15

  • 11:06 - optimized_housekeeping is turned on for gitlab-org group. This setting was not effective.
  • 12:13 - optimized_housekeeping is turned on for gitlab-org/gitlab project.
  • 12:24 - First OptimizeHousekeeping RPC is run.
  • 12:30 - OptimizeHousekeeping RPC finishes.
  • 12:30 - We start to see Internal errors for gitlab-org/gitlab.
  • 12:47 - First reports of users that commits are missing.
  • 13:24 - First report in the Gitaly channel that commits are missing.
  • 13:25 - optimized_housekeeping flag is deleted in production.
  • 13:34 - optimized_housekeeping flag is deleted in staging.
  • 13:41 - @pks-t declares incident in Slack.

2022-03-16

  • 14:40: Fix is deployed to production.

2022-03-17

  • 13:00: Three references pointing to missing objects have been removed. The node stops to emit "bad object" errors.
  • 13:22: Marked incident as mitigated.

Create related issues

Use the following links to create related issues to this incident if additional work needs to be completed after it is resolved:

  • Support contact request
  • Corrective action
  • Investigation followup
  • Confidential issue
  • QA investigation

Takeaways

  • ...

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.

  • ...

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

  1. Who was impacted by this incident? (i.e. external customers, internal customers)
    1. ...
  2. What was the customer experience during the incident? (i.e. preventing them from doing X, incorrect display of Y, ...)
    1. ...
  3. How many customers were affected?
    1. ...
  4. If a precise customer impact number is unknown, what is the estimated impact (number and ratio of failed requests, amount of traffic drop, ...)?
    1. ...

What were the root causes?

  • ...

Incident Response Analysis

  1. How was the incident detected?
    1. ...
  2. How could detection time be improved?
    1. ...
  3. How was the root cause diagnosed?
    1. ...
  4. How could time to diagnosis be improved?
    1. ...
  5. How did we reach the point where we knew how to mitigate the impact?
    1. ...
  6. How could time to mitigation be improved?
    1. ...
  7. What went well?
    1. ...

Post Incident Analysis

  1. Did we have other events in the past with the same root cause?
    1. ...
  2. Do we have existing backlog items that would've prevented or greatly reduced the impact of this incident?
    1. ...
  3. Was this incident triggered by a change (deployment of code or change to infrastructure)? If yes, link the issue.
    1. ...

What went well?

  • ...

Guidelines

  • Blameless RCA Guideline

Resources

  1. If the Situation Zoom room was utilised, recording will be automatically uploaded to Incident room Google Drive folder (private)
Edited Mar 17, 2022 by Patrick Steinhardt
Assignee Loading
Time tracking Loading