{
  "id": "mongodb/rollback-detected-on-replica-set",
  "signature": "MongoServerError: RollbackDetected: rollback occurred on replica set member rs1:27017",
  "signature_zh": "MongoServerError：RollbackDetected：副本集成员 rs1:27017 上发生回滚",
  "regex": "MongoServerError: RollbackDetected: rollback occurred on replica set member .*:\\d+",
  "domain": "mongodb",
  "category": "runtime_error",
  "subcategory": null,
  "root_cause": "A secondary node in a replica set experienced a rollback because it applied writes that were later overwritten by the primary.",
  "root_cause_type": "generic",
  "root_cause_zh": "副本集中的从节点发生了回滚，因为它应用了后来被主节点覆盖的写入操作。",
  "versions": [
    {
      "version": "mongodb-5.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb-6.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    },
    {
      "version": "mongodb-7.0",
      "introduced": null,
      "deprecated": null,
      "removed": null,
      "behavior_change": null,
      "status": "active"
    }
  ],
  "os_specific": {},
  "dead_ends": [
    {
      "action": "",
      "why_fails": "Ignoring the rollback and continuing operations can cause data inconsistency between nodes.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Manually forcing the secondary to become primary without resolving the rollback can cause data loss.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    },
    {
      "action": "",
      "why_fails": "Decreasing the oplog size to save disk space increases the likelihood of future rollbacks.",
      "fail_rate": 0.5,
      "condition": "",
      "sources": []
    }
  ],
  "workarounds": [
    {
      "action": "Check the rollback data in the rollback/ directory on the affected node and manually restore any necessary documents using mongorestore.",
      "success_rate": 0.8,
      "how": "Check the rollback data in the rollback/ directory on the affected node and manually restore any necessary documents using mongorestore.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Ensure all secondary nodes have caught up with the primary by monitoring replication lag and increasing oplog size if needed.",
      "success_rate": 0.85,
      "how": "Ensure all secondary nodes have caught up with the primary by monitoring replication lag and increasing oplog size if needed.",
      "condition": "",
      "sources": []
    },
    {
      "action": "Set writeConcern to majority to reduce the chance of rollbacks by ensuring writes are acknowledged by a majority of nodes.",
      "success_rate": 0.75,
      "how": "Set writeConcern to majority to reduce the chance of rollbacks by ensuring writes are acknowledged by a majority of nodes.",
      "condition": "",
      "sources": []
    }
  ],
  "workarounds_zh": [
    "Check the rollback data in the rollback/ directory on the affected node and manually restore any necessary documents using mongorestore.",
    "Ensure all secondary nodes have caught up with the primary by monitoring replication lag and increasing oplog size if needed.",
    "Set writeConcern to majority to reduce the chance of rollbacks by ensuring writes are acknowledged by a majority of nodes."
  ],
  "transition_graph": {
    "leads_to": [],
    "preceded_by": [],
    "frequently_confused_with": []
  },
  "official_doc_url": "https://www.mongodb.com/docs/manual/core/replica-set-rollbacks/",
  "official_doc_section": null,
  "error_code": null,
  "verification_tier": "ai_generated",
  "confidence": 0.86,
  "fix_success_rate": 0.8,
  "resolvable": "partial",
  "first_seen": "2024-11-05",
  "last_confirmed": "2024-06-01",
  "last_updated": "2024-06-01",
  "evidence_count": 1,
  "tags": [],
  "locale": "en",
  "aliases": []
}