devopsbench-100 / trajectories /dob100-044-analytics-prefetch.jsonl
SamuelChien821's picture
Upload folder using huggingface_hub
ea61660 verified
Raw
History Blame Contribute Delete
13.7 kB
{"args": {"key": "ENG-2103"}, "ok": true, "result": "{\"assignee\": \"\", \"description\": \"analytics-worker error_rate_pct is 6.0% against a 2.0% SLO (alarm 9609) Investigate the root cause, ship the fix through the standard workflow, and follow the deployment policy.\", \"key\": \"ENG-2103\", \"priority\": \"high\", \"service\": \"analytics-worker\", \"status\": \"open\", \"ticket_id\": 9103, \"title\": \"Analytics worker restarting under queue load\", \"type\": \"bug\"}", "tool": "get_ticket"}
{"args": {"query": "deployment"}, "ok": true, "result": "{\"count\": 10, \"rows\": [{\"author\": \"Priya Nair\", \"day\": 268, \"doc_id\": 9601, \"kind\": \"policy\", \"service\": \"\", \"title\": \"Deployment policy\"}, {\"author\": \"Diego Ramos\", \"day\": 254, \"doc_id\": 9602, \"kind\": \"policy\", \"service\": \"\", \"title\": \"Database migration policy\"}, {\"author\": \"Mei Tanaka\", \"day\": 233, \"doc_id\": 9604, \"kind\": \"runbook\", \"service\": \"search\", \"title\": \"Search caching\"}, {\"author\": \"Priya Nair\", \"day\": 271, \"doc_id\": 9606, \"kind\": \"runbook\", \"service\": \"\", \"title\": \"Incident response\"}, {\"author\": \"Mei Tanaka\", \"day\": 247, \"doc_id\": 9607, \"kind\": \"runbook\", \"service\": \"\", \"title\": \"Feature flags\"}, {\"author\": \"Alex Osei\", \"day\": 263, \"doc_id\": 9609, \"kind\": \"runbook\", \"service\": \"\", \"title\": \"Security response\"}, {\"author\": \"Mei Tanaka\", \"day\": 221, \"doc_id\": 9613, \"kind\": \"runbook\", \"service\": \"media-service\", \"title\": \"CDN and media delivery\"}, {\"author\": \"Diego Ramos\", \"day\": 288, \"doc_id\": 9617, \"kind\": \"design_doc\", \"service\": \"\", \"title\": \"Loyalty points program\"}, {\"author\": \"Priya Nair\", \"day\": 174, \"doc_id\": 9619, \"kind\": \"adr\", \"service\": \"\", \"title\": \"ADR-021: Standardize on staged canary deploys\"}, {\"author\": \"Priya Nair\", \"day\": 290, \"doc_id\": 9625, \"kind\": \"onboarding\", \"service\": \"\", \"title\": \"Engineering onboarding: how we ship\"}]}", "tool": "search_docs"}
{"args": {"title": "Deployment policy"}, "ok": true, "result": "{\"author\": \"Priya Nair\", \"body\": \"# Deployment policy\\n\\nThis policy is binding for every NovaCart service. It is enforced partly by\\ntooling and partly by review; deviations are treated as incidents.\\n\\n## Staging first, always\\n\\nEvery production deploy must first succeed on staging with the **same version**.\\n`deploy_service(service, environment=\\\"staging\\\", version=V)` must be in a\\n`succeeded` state for version `V` before `deploy_service(service,\\nenvironment=\\\"production\\\", version=V)` is accepted. Deploying a version to\\nproduction that has never been deployed to staging is rejected. There is no\\n\\\"hotfix exception\\\" - a hotfix is still a version, and it still goes to staging\\nfirst. In practice this costs about ninety seconds and it has caught eleven bad\\nreleases in the last two quarters.\\n\\n## Tier-1 services canary\\n\\nTier-1 services are the four that are directly in the money path or in front of\\ncustomers:\\n\\n- `storefront-web`\\n- `api-gateway`\\n- `checkout`\\n- `payments`\\n\\nFor these, the production deploy must be a canary: call `deploy_service` with\\n`canary_percent <= 25`. Twenty-five percent is a ceiling, not a target; 10% is\\nthe usual first step for anything touching payment capture. The canary must then\\nbe assessed with `assess_canary` and may only be promoted with `promote_canary`\\nonce the assessment reports healthy. Promoting a canary that `assess_canary`\\nreports as unhealthy is the single most common way engineers turn a small\\nregression into a SEV1 - see \\\"Postmortem: api-gateway v5.1.0 latency surge\\\"\\nin the incident archive.\\n\\nTier-2 services (`catalog`, `notifications`, `search`) deploy at 100% directly,\\nstill staging-first.\\n\\n## Rollback\\n\\n`rollback_deployment` is **exempt** from the staging-first rule. During an\\nincident you roll back immediately; you do not stage a rollback. Rolling back\\nreturns the service to the previously succeeded production version. See the\\n\\\"Incident response\\\" runbook for where rollback sits in the mitigation ordering,\\nand \\\"Rollback and recovery\\\" for the mechanics.\\n\\n## Deployment score\\n\\nEvery deploy that trips an alarm counts against the owning team's deployment\\nscore, which is reviewed monthly. A tripped alarm on a canary that was correctly\\nassessed and *not* promoted is recorded but weighted at one quarter - the\\ncanary did its job. This is deliberate: we would rather you canary and catch it\\nthan skip the canary and get lucky.\\n\\n## Related\\n\\n- \\\"Database migration policy\\\" - migrations precede the code that needs them.\\n- \\\"ADR-021: Standardize on staged canary deploys\\\" - why we chose this shape.\\n- \\\"Engineering onboarding: how we ship\\\" - the end-to-end workflow.\\n\", \"day\": 268, \"doc_id\": 9601, \"kind\": \"policy\", \"service\": \"\", \"title\": \"Deployment policy\"}", "tool": "get_document"}
{"args": {"query": "queue"}, "ok": true, "result": "{\"count\": 6, \"rows\": [{\"author\": \"Priya Nair\", \"day\": 241, \"doc_id\": 9603, \"kind\": \"runbook\", \"service\": \"\", \"title\": \"Retry and timeout standard\"}, {\"author\": \"Priya Nair\", \"day\": 236, \"doc_id\": 9611, \"kind\": \"runbook\", \"service\": \"\", \"title\": \"Connection pool sizing\"}, {\"author\": \"Priya Nair\", \"day\": 226, \"doc_id\": 9612, \"kind\": \"runbook\", \"service\": \"notifications\", \"title\": \"Queue consumer tuning\"}, {\"author\": \"Diego Ramos\", \"day\": 205, \"doc_id\": 9615, \"kind\": \"design_doc\", \"service\": \"payments\", \"title\": \"Payments settlement pipeline\"}, {\"author\": \"Mei Tanaka\", \"day\": 183, \"doc_id\": 9622, \"kind\": \"postmortem\", \"service\": \"search\", \"title\": \"Postmortem: search cache stampede after index rebuild\"}, {\"author\": \"Alex Osei\", \"day\": 250, \"doc_id\": 9627, \"kind\": \"policy\", \"service\": \"\", \"title\": \"Observability, SLOs, and alerting\"}]}", "tool": "search_docs"}
{"args": {"title": "Queue consumer tuning"}, "ok": true, "result": "{\"author\": \"Priya Nair\", \"body\": \"# Queue consumer tuning\\n\\nOwner: platform. Primary consumer service: `notifications` (tier 2), which\\ndrains the email, SMS, and push delivery queues. The same rules apply to any\\nservice that consumes from the message broker.\\n\\n## The rule\\n\\n`prefetch_count` must be a **bounded** value. **Recommended: 50.**\\n\\n`prefetch_count=0` means **unlimited prefetch** and is the single worst setting\\nin this runbook.\\n\\n## What prefetch does\\n\\nPrefetch is the number of unacknowledged messages the broker will push to a\\nsingle consumer. With `prefetch_count=50`, a consumer holds at most 50\\nin-flight messages; the broker will not send a 51st until one is acknowledged.\\nThis is the backpressure mechanism - it is what lets a slow consumer tell the\\nbroker to slow down.\\n\\nWith `prefetch_count=0` there is no backpressure. The broker pushes the entire\\nbacklog to whichever consumer connects first. Consequences, all of which we have\\nseen in `notifications`:\\n\\n- **Memory pressure.** A 400k-message backlog lands in one process's heap. RSS\\n climbs until the container hits its memory limit.\\n- **Consumer restarts.** The container is OOM-killed, the unacknowledged\\n messages are redelivered, the restarted consumer grabs them all again, and it\\n is killed again. A restart loop that looks like a broker problem and is not.\\n- **Terrible load distribution.** One consumer holds everything while its\\n siblings sit idle, so scaling out does nothing.\\n- **Head-of-line latency.** A high-priority message sits behind 400k others.\\n\\n## Sizing\\n\\n| Message profile | prefetch_count |\\n| ------------------------------ | -------------- |\\n| Fast, uniform (a few ms each) | 100-200 |\\n| Standard delivery work | **50** |\\n| Slow or variable (seconds) | 5-10 |\\n| Long-running jobs (minutes) | 1 |\\n\\nRule of thumb: `prefetch_count` should be roughly the number of messages a\\nconsumer can process in one to two seconds. Start at 50 and adjust with\\nevidence.\\n\\n## Related settings\\n\\n- `smtp_pool` on `notifications` bounds concurrent SMTP connections. Prefetch\\n above the SMTP concurrency just buys queueing inside the process.\\n- Ack **after** the work is done, never on receipt. Acking on receipt turns a\\n crash into silent message loss.\\n- Dead-letter after 5 delivery attempts so a poison message cannot loop forever.\\n\\n## Changing it\\n\\nRepo config: PR with a `config` change, CI, merge, staging, production.\\n`notifications` is tier 2 - straight 100% deploy after staging. Watch consumer\\nmemory and queue depth for one full peak after the change.\\n\", \"day\": 226, \"doc_id\": 9612, \"kind\": \"runbook\", \"service\": \"notifications\", \"title\": \"Queue consumer tuning\"}", "tool": "get_document"}
{"args": {"service": "analytics-worker"}, "ok": true, "result": "{\"count\": 1, \"rows\": [{\"environment\": \"production\", \"level\": \"ERROR\", \"log_id\": 9021, \"message\": \"consumer restarted after MemoryError; prefetch_count=0 means unlimited prefetch from rabbitmq\", \"service\": \"analytics-worker\"}]}", "tool": "search_logs"}
{"args": {"body": "Root cause: the consumer runs out of memory because it prefetches the whole queue. Applies the standard from the 'Queue consumer tuning' runbook. Fixes ENG-2103.", "changes": [{"change_type": "config", "payload": {"key": "prefetch_count", "value": "50"}}], "service": "analytics-worker", "ticket_key": "ENG-2103", "title": "analytics-worker: set prefetch_count=50"}, "ok": true, "result": "{\"next\": \"run_ci(pr_number=9203) then merge_pull_request(pr_number=9203)\", \"ok\": true, \"pr_number\": 9203, \"service\": \"analytics-worker\", \"status\": \"open\"}", "tool": "open_pull_request"}
{"args": {"pr_number": 9203}, "ok": true, "result": "{\"detail\": \"intermittent failure: test_rollup_window (rerun may pass)\", \"ok\": true, \"pr_number\": 9203, \"run_id\": 13, \"service\": \"analytics-worker\", \"stages\": [{\"detail\": \"compiled and packaged\", \"stage\": \"build\", \"status\": \"passed\"}, {\"detail\": \"unit suite green\", \"stage\": \"unit\", \"status\": \"passed\"}, {\"detail\": \"intermittent failure: test_rollup_window (rerun may pass)\", \"stage\": \"integration\", \"status\": \"failed\"}, {\"detail\": \"upstream stage failed\", \"stage\": \"regression\", \"status\": \"skipped\"}], \"status\": \"failed\"}", "tool": "run_ci"}
{"args": {"pr_number": 9203}, "ok": true, "result": "{\"detail\": \"all stages passed\", \"ok\": true, \"pr_number\": 9203, \"run_id\": 14, \"service\": \"analytics-worker\", \"stages\": [{\"detail\": \"compiled and packaged\", \"stage\": \"build\", \"status\": \"passed\"}, {\"detail\": \"unit suite green\", \"stage\": \"unit\", \"status\": \"passed\"}, {\"detail\": \"integration suite green\", \"stage\": \"integration\", \"status\": \"passed\"}, {\"detail\": \"no regressions in dependent services\", \"stage\": \"regression\", \"status\": \"passed\"}], \"status\": \"passed\"}", "tool": "run_ci"}
{"args": {"pr_number": 9203}, "ok": true, "result": "{\"merged_version\": \"v2.1.8\", \"next\": \"deploy_service(service=..., environment=\\\"staging\\\")\", \"ok\": true, \"pr_number\": 9203, \"service\": \"analytics-worker\"}", "tool": "merge_pull_request"}
{"args": {"environment": "staging", "service": "analytics-worker"}, "ok": true, "result": "{\"applied\": true, \"canary_percent\": 100, \"deployment_id\": 9273, \"environment\": \"staging\", \"ok\": true, \"service\": \"analytics-worker\", \"status\": \"succeeded\", \"version\": \"v2.1.8\"}", "tool": "deploy_service"}
{"args": {"environment": "production", "service": "analytics-worker"}, "ok": true, "result": "{\"applied\": true, \"canary_percent\": 100, \"deployment_id\": 9274, \"environment\": \"production\", \"ok\": true, \"service\": \"analytics-worker\", \"status\": \"succeeded\", \"version\": \"v2.1.8\"}", "tool": "deploy_service"}
{"args": {"service": "analytics-worker"}, "ok": true, "result": "{\"count\": 2, \"rows\": [{\"environment\": \"production\", \"metric\": \"error_rate_pct\", \"service\": \"analytics-worker\", \"value\": 0.4}, {\"environment\": \"production\", \"metric\": \"latency_p99_ms\", \"service\": \"analytics-worker\", \"value\": 300.0}]}", "tool": "query_metrics"}
{"args": {"alert_id": 9609}, "ok": true, "result": "{\"alert_id\": 9609, \"ok\": true, \"status\": \"acknowledged\"}", "tool": "acknowledge_alert"}
{"args": {"alert_id": 9609}, "ok": true, "result": "{\"alert_id\": 9609, \"ok\": true, \"status\": \"resolved\"}", "tool": "resolve_alert"}
{"args": {"component": "analytics-worker", "project": "ENG"}, "ok": true, "result": "{\"count\": 1, \"rows\": [{\"assignee\": \"Alex Osei\", \"component\": \"analytics-worker\", \"created_day\": 415, \"issue_type\": \"Bug\", \"key\": \"ENG-2103\", \"priority\": \"High\", \"project\": \"ENG\", \"resolution\": \"\", \"status\": \"In Progress\", \"summary\": \"Analytics worker restarting under queue load\", \"updated_day\": 419}]}", "tool": "jira_search"}
{"args": {"key": "ENG-2103", "resolution": "Fixed", "status": "Done"}, "ok": true, "result": "{\"key\": \"ENG-2103\", \"ok\": true, \"resolution\": \"Fixed\", \"status\": \"Done\"}", "tool": "jira_transition_issue"}
{"args": {"key": "ENG-2103", "status": "done"}, "ok": true, "result": "{\"assignee\": \"\", \"key\": \"ENG-2103\", \"ok\": true, \"status\": \"done\"}", "tool": "update_ticket"}
{"verdict": {"passed": true, "reward": 1.0, "score": 1.0}}