---
title: "The Query Strikes Again"
description: "A customer's bulk removal of users triggered Slack's \"forget user\" async job, which fanned out into a huge number of \"leave channel\" jobs."
url: "https://swe.quest/articles/the-query-strikes-again-fa807954ef58b362"
canonical: "https://slack.engineering/the-query-strikes-again/"
source: "Slack Engineering"
published: "2023-11-15"
difficulty: "medium"
kind: "Incident"
reading_minutes: 13
tags: ["incident-response","mysql","resilience","replication","distributed-databases"]
---

# The Query Strikes Again

A post on [Slack Engineering](https://swe.quest/sources/slack.md), published 2023-11-15, 13 min read, Incident. Original: [https://slack.engineering/the-query-strikes-again/](https://slack.engineering/the-query-strikes-again/)

## Summary

A customer's bulk removal of users triggered Slack's "forget user" async job, which fanned out into a huge number of "leave channel" jobs. These hammered a single Vitess shard holding 6% of thread-subscription data. Replication lag and OOM-killed MySQL primaries caused a promote-replace loop, because new replicas could not catch up from backup under the write load and automation deprovisioned them as unhealthy. Mitigations were manually provisioning larger replicas, scoping the job's queries and UPDATEs to the single channel being left, skipping client notifications for deactivated users, and temporarily disabling Thread View. Long-term fixes include fixing the replacement edge case, adding query throttling and circuit breakers (with contributions upstream to Vitess), and restructuring the job to avoid per-channel fan-out.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Incidents & postmortems](https://swe.quest/tags/incident-response.md) (Reliability & operations)
- [MySQL](https://swe.quest/tags/mysql.md) (Data & databases)
- [Resilience](https://swe.quest/tags/resilience.md) (Distributed systems)
- [Replication](https://swe.quest/tags/replication.md) (Distributed systems)
- [Distributed databases](https://swe.quest/tags/distributed-databases.md) (Data & databases)

## Prerequisites

- MySQL replication ([easy posts on MySQL](https://swe.quest/tags/mysql.md?difficulty=easy))
- database sharding basics ([easy posts on Databases](https://swe.quest/tags/databases.md?difficulty=easy))
- asynchronous job queues ([easy posts on Queues & messaging](https://swe.quest/tags/messaging.md?difficulty=easy))

## Keywords

Vitess, MySQL, Slack, VTGate, circuit breaker, OOM killer

## Related posts

- [Slack’s Incident on 2-22-22](https://swe.quest/articles/slack-s-incident-on-2-22-22-7a35cde32cfb5fd8.md): Slack Engineering · 2022-04-26 · Medium · 12 min read · Incidents & postmortems, Caching, Resilience, MySQL, Distributed systems
  A Consul agent rolling restart caused Mcrib, Slack's memcached control plane, to replace and flush cache nodes, dropping hit rates during peak traffic.
- [Incident Report: November 20th, 2025](https://swe.quest/articles/incident-report-november-20th-2025-8a5b09711237e8e3.md): Railway · 2025-11-21 · Easy · 3 min read · Incidents & postmortems, Resilience, Deployment, Queues & messaging
  A dip in GitHub push webhooks followed by a 10x surge flooded Railway's asynchronous deployment task queue, delaying all new deployments for about two and a half hours on November 20th, 2025.
- [Incident Report: June 11th, 2024](https://swe.quest/articles/incident-report-june-11th-2024-9cee66de3a3331a6.md): Railway · 2024-06-11 · Medium · 4 min read · Incidents & postmortems, Scheduling, Resilience, Cloud platforms
  A buggy host-migration workflow that issued a redeploy per replica rather than per deployment coincided with normal deploys, hourly crons and failed European placements, quadrupling load on an IO-heavy machine status endpoint that the scheduler polls across all regions.
- [Break Stuff on Purpose](https://swe.quest/articles/break-stuff-on-purpose-87dc2221ffb9f4a6.md): Slack Engineering · 2024-12-10 · Medium · 5 min read · Chaos engineering, Incidents & postmortems, Observability, SRE
  Slack's internal Kibana cluster failed in January 2024 after running out of disk, a consequence of co-locating its Elasticsearch storage on the same hosts as the application.
- [Incident Report: November 25th, 2025](https://swe.quest/articles/incident-report-november-25th-2025-0f5ac3667ca5f9ba.md): Railway · 2025-11-25 · Medium · 3 min read · Incidents & postmortems, Resilience, Scheduling
  Slow GitHub API calls (about 4x normal p95 latency) during peak hours backed up Railway's Temporal-based task queue, causing workers to run out of memory and crash in a cascading thundering-herd pattern as surviving and newly started workers were overwhelmed by the backlog.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
