{
  "id": "go/grpc-aborted-concurrency",
  "signature": "rpc error: code = Aborted desc = concurrency conflict: version mismatch",
  "signature_zh": "rpc 错误：code = Aborted desc = 并发冲突：版本不匹配",
  "regex": "rpc\\ error:\\ code\\ =\\ Aborted\\ desc\\ =\\ concurrency\\ conflict:\\ version\\ mismatch",
  "domain": "go",
  "category": "data_error",
  "subcategory": null,
  "root_cause": "The operation was aborted due to a concurrency conflict, such as an optimistic locking failure where the resource version changed.",
  "root_cause_type": "generic",
  "root_cause_zh": "由于并发冲突（例如乐观锁失败导致资源版本更改），操作被中止。",
  "versions": [
    {
      "version": "1.x",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "The version is outdated; retrying with the same version will fail again.",
      "fail_rate": 1.0,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "This can lead to lost updates and data inconsistency.",
      "fail_rate": 0.9,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "",
      "success_rate": 0.95,
      "how": "for {\n    resource, err := client.Get(ctx, &GetRequest{Id: id})\n    if err != nil { return err }\n    resource.Data = newData\n    _, err = client.Update(ctx, resource)\n    if status.Code(err) != codes.Aborted {\n        return err\n    }\n    // retry\n}",
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "success_rate": 0.9,
      "how": "// Include version in the update request\nreq := &UpdateRequest{Id: id, Data: newData, Version: currentVersion}\n_, err := client.Update(ctx, req)\nif status.Code(err) == codes.Aborted {\n    // handle conflict\n}",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": null,
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.88,
  "fix_success_rate": 0.8,
  "resolvable": "true",
  "first_seen": "2025-01-10",
  "last_confirmed": "2025-01-01",
  "last_updated": "2025-01-01",
  "evidence_count": 0,
  "tags": [],
  "locale": "en",
  "aliases": []
}