|
| 1 | +# Cross-node transaction safety |
| 2 | + |
| 3 | +PGRAC refuses a statement when it cannot prove the cluster-wide transaction |
| 4 | +state or row-version relationship required for a safe visibility, update, |
| 5 | +delete, or row-lock decision. The server does not guess that an unresolved |
| 6 | +transaction committed, aborted, or stopped conflicting. |
| 7 | + |
| 8 | +This page describes the user-visible safety and troubleshooting contract. It |
| 9 | +does not describe internal storage formats or coordination protocols. |
| 10 | + |
| 11 | +## Safety contract |
| 12 | + |
| 13 | +- A cross-node result is accepted only when the installed build can prove the |
| 14 | + required transaction identity and state. |
| 15 | +- Before modifying a row, the server confirms that the row version and its |
| 16 | + cluster ownership have not changed while remote information was obtained. |
| 17 | +- Missing, stale, conflicting, malformed, or changing evidence fails closed |
| 18 | + before the statement may use it as a successful result. |
| 19 | +- Read evidence does not grant write permission. A modification still requires |
| 20 | + the cluster's exclusive current-block ownership. |
| 21 | +- Background cleanup must not change an uncertain result into success merely |
| 22 | + to free capacity or reduce latency. |
| 23 | + |
| 24 | +## Operator-visible failures |
| 25 | + |
| 26 | +Depending on the operation and installed release, an unproved transaction or |
| 27 | +MultiXact result can surface as SQLSTATE `53R97` or `53R9C`. These errors mean |
| 28 | +that the statement was refused. By themselves, they do not prove committed-data |
| 29 | +loss or on-disk corruption. |
| 30 | + |
| 31 | +There is no supported GUC, timeout increase, SQL procedure, or manual cleanup |
| 32 | +that makes an unproved result safe. |
| 33 | + |
| 34 | +## Safe response |
| 35 | + |
| 36 | +1. Preserve the complete client error, including SQLSTATE, detail, hint, |
| 37 | + context, backend PID, node, and timestamp. |
| 38 | +2. Roll back the failed transaction. Do not retry one statement inside an |
| 39 | + already-aborted transaction. |
| 40 | +3. Confirm that every node is ready and uses the expected build and cluster |
| 41 | + configuration. |
| 42 | +4. Collect server logs and wait information from every node for the same time |
| 43 | + window. |
| 44 | +5. Retry the complete application transaction only under a bounded retry policy |
| 45 | + that is safe for the application. |
| 46 | + |
| 47 | +Useful first checks include: |
| 48 | + |
| 49 | +```sql |
| 50 | +SELECT pid, |
| 51 | + application_name, |
| 52 | + state, |
| 53 | + wait_event_type, |
| 54 | + wait_event, |
| 55 | + xact_start, |
| 56 | + query_start |
| 57 | + FROM pg_stat_activity |
| 58 | + ORDER BY query_start NULLS LAST, pid; |
| 59 | + |
| 60 | +SELECT * |
| 61 | + FROM pg_cluster_state |
| 62 | + ORDER BY category, key; |
| 63 | +``` |
| 64 | + |
| 65 | +See [System views](system-views.md), [cluster wait events](wait-events.md), and |
| 66 | +the [verification guide](../user-guide/verification.md) for the supported |
| 67 | +diagnostic surfaces. |
| 68 | + |
| 69 | +## Release and deployment boundary |
| 70 | + |
| 71 | +For current four-node validation, install the same eligible build on every |
| 72 | +node. Mixed-version rolling compatibility for this transaction path is not a |
| 73 | +current validation claim; a protocol mismatch must remain fail closed rather |
| 74 | +than be bypassed. |
| 75 | + |
| 76 | +Documentation alone is not release certification. Use the release notes and |
| 77 | +verification results shipped with the installed artifact to determine whether |
| 78 | +a particular cross-node path is included in the validated release surface. |
0 commit comments