{"record":{"id":"2681bcf34562176e","repo":"nats-io/nats-server","slug":"unsafe-quorum-rescue-stopped-quorum-updated-to-d","errorCode":null,"errorMessage":"Unsafe quorum rescue stopped, quorum updated to %d","messagePattern":"Unsafe quorum rescue stopped, quorum updated to (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/raft.go","lineNumber":1306,"sourceCode":"\t// a quorum.\n\tn.csz = csz\n\tn.recalcQuorum()\n\n\tn.sendPeerState()\n\treturn nil\n}\n\n// recalcQuorum recalculates the number of nodes needed to establish quorum.\n// While an unsafe quorum rescue is active (see RescueQuorum) the rescued quorum\n// is kept, unless the natural quorum drops to be equal or below it.\n// Lock should be held.\nfunc (n *raft) recalcQuorum() {\n\tqn := n.csz/2 + 1\n\tif n.rescue != nil {\n\t\tif qn > n.qn {\n\t\t\treturn\n\t\t}\n\t\tn.warn(\"Unsafe quorum rescue stopped, quorum updated to %d\", qn)\n\t\tn.rescue.Stop()\n\t\tn.rescue = nil\n\t}\n\tn.qn = qn\n}\n\n// RescueQuorum unsafely lowers the number of nodes needed to establish quorum.\n// This is a disaster recovery measure for a group that has permanently lost enough\n// peers that it can't elect a leader anymore, allowing the surviving peers to\n// re-form quorum and peer-remove the lost peers.\nfunc (n *raft) RescueQuorum(qn int) (prev, cur int, err error) {\n\tn.Lock()\n\tdefer n.Unlock()\n\n\tprev = n.qn\n\tif n.State() == Closed {\n\t\treturn prev, 0, errNodeClosed\n\t}","sourceCodeStart":1288,"sourceCodeEnd":1324,"githubUrl":"https://github.com/nats-io/nats-server/blob/3a66a489d262bf89b71a71c955c94920394532f3/server/raft.go#L1288-L1324","documentation":"An active unsafe quorum rescue (artificially lowered quorum) has ended because the natural quorum recalculated to a value equal or below the rescued value — i.e. enough peers returned that the real quorum is now sufficient. The rescue is stopped and normal quorum is used.","triggerScenarios":"Thrown at server/raft.go:1306 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["No action needed; this is the expected healthy end of a rescue","Confirm lost peers are recovered or replaced to keep quorum durable","Do not leave the cluster in rescued state long-term"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"3a66a489d262bf89b71a71c955c94920394532f3","analyzedAt":"2026-09-02T04:41:54.247Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-08T15:18:49.778Z"}