Skip to content

Commit 4dfbbcc

Browse files
author
SqlRush
committed
docs: publish sanitized transaction safety guidance
1 parent d252e44 commit 4dfbbcc

8 files changed

Lines changed: 79 additions & 7872 deletions

CHANGELOG.md

Lines changed: 0 additions & 36 deletions
This file was deleted.

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ User-facing manual:
7878
| Configuration (`cluster.*` GUCs + `pgrac.conf`) | [docs/user-guide/configuration.md](docs/user-guide/configuration.md) |
7979
| System views reference | [docs/reference/system-views.md](docs/reference/system-views.md) |
8080
| Wait events reference | [docs/reference/wait-events.md](docs/reference/wait-events.md) |
81+
| Cross-node transaction safety | [docs/reference/cluster-transaction-safety.md](docs/reference/cluster-transaction-safety.md) |
8182
| Architecture overview | [docs/architecture/overview.md](docs/architecture/overview.md) |
8283

8384
PostgreSQL upstream documentation lives under `doc/` and is shipped unchanged

docs/ad-024-canonical-active-transaction-authority.md

Lines changed: 0 additions & 1526 deletions
This file was deleted.
Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
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

Comments
 (0)