Skip to content

Commit 236c9e5

Browse files
authored
ref(cells): Update hybrid cloud debugging skill with cells terminology (#111744)
1 parent a28359e commit 236c9e5

File tree

1 file changed

+10
-10
lines changed

1 file changed

+10
-10
lines changed

.agents/skills/hybrid-cloud-outboxes/references/debugging.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Understanding the pipeline helps locate where things break:
66

77
1. **Model save/delete** writes outbox row inside `outbox_context(transaction.atomic(...))`
88
2. **On commit**: if `flush=True`, `drain_shard()` runs synchronously for that shard
9-
3. **Periodic task**: `enqueue_outbox_jobs` (region) / `enqueue_outbox_jobs_control` (control) runs on a cron schedule
9+
3. **Periodic task**: `enqueue_outbox_jobs` (cell) / `enqueue_outbox_jobs_control` (control) runs on a cron schedule
1010
4. **`schedule_batch`** partitions the ID range into `CONCURRENCY=5` chunks and spawns `drain_outbox_shards` tasks
1111
5. **`drain_outbox_shards`** calls `process_outbox_batch` which:
1212
- Calls `find_scheduled_shards(lo, hi)` to find shards with `scheduled_for <= now`
@@ -71,9 +71,9 @@ Both tables share these columns:
7171

7272
`sentry_controloutbox` has one additional column:
7373

74-
| Column | Type | Description |
75-
| ------------- | ------- | ----------------------------- |
76-
| `region_name` | varchar | Target region for this outbox |
74+
| Column | Type | Description |
75+
| ------------- | ------- | --------------------------- |
76+
| `region_name` | varchar | Target cell for this outbox |
7777

7878
### Resolving Enum Values
7979

@@ -92,10 +92,10 @@ When generating SQL for a developer, **print the query to the terminal** so they
9292
2. Comments mapping integer values to their enum names
9393
3. Reasonable `LIMIT` clauses to avoid overwhelming output
9494

95-
#### Find stuck shards (region)
95+
#### Find stuck shards (cell)
9696

9797
```sql
98-
-- Find region outbox shards stuck in backoff
98+
-- Find cell outbox shards stuck in backoff
9999
-- shard_scope: 0 = ORGANIZATION_SCOPE, 1 = USER_SCOPE, etc.
100100
-- category: see OutboxCategory enum in category.py
101101
SELECT
@@ -199,7 +199,7 @@ LIMIT 10;
199199

200200
When a developer asks you to debug stuck outboxes:
201201

202-
1. **Determine the table**: Ask which model or direction is involved, or infer from context. Use `sentry_regionoutbox` for region models, `sentry_controloutbox` for control models.
202+
1. **Determine the table**: Ask which model or direction is involved, or infer from context. Use `sentry_regionoutbox` for cell models, `sentry_controloutbox` for control models.
203203
2. **Resolve enum values**: Read `src/sentry/hybridcloud/outbox/category.py` to get the integer values for the relevant `OutboxCategory` and `OutboxScope`.
204204
3. **Construct the query**: Use the templates above, substituting resolved values. Always add comments with the human-readable enum names.
205205
4. **Print to terminal**: Output the final SQL so the developer can copy it. Do NOT attempt to run it — you don't have production database access.
@@ -212,10 +212,10 @@ When a developer asks you to debug stuck outboxes:
212212
The `should_skip_shard()` method checks these options:
213213

214214
```python
215-
# Skip specific organization shards (region outboxes)
215+
# Skip specific organization shards (cell outboxes)
216216
"hybrid_cloud.authentication.disabled_organization_shards": [org_id_1, org_id_2]
217217

218-
# Skip specific user shards (region/control outboxes)
218+
# Skip specific user shards (cell/control outboxes)
219219
"hybrid_cloud.authentication.disabled_user_shards": [user_id_1, user_id_2]
220220
```
221221

@@ -252,7 +252,7 @@ For local debugging or in a Django shell:
252252
```python
253253
from sentry.hybridcloud.models.outbox import CellOutbox, ControlOutbox
254254

255-
# Top 10 deepest region shards
255+
# Top 10 deepest cell shards
256256
for shard in CellOutbox.get_shard_depths_descending(limit=10):
257257
print(f"Scope={shard['shard_scope']} ID={shard['shard_identifier']} Depth={shard['depth']}")
258258
```

0 commit comments

Comments
 (0)