Skip to content

Commit d49bc46

Browse files
author
Ibrar Ahmed
committed
Merge branch 'main' into zodan-in-core-node.
2 parents 5d9fe35 + d05e2e2 commit d49bc46

36 files changed

Lines changed: 1199 additions & 193 deletions

‎docs/getting_started.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,13 +80,13 @@ The examples use PostgreSQL 18. If you switch to 15, 16, 17, or 19, update every
8080
For RHEL/Rocky Linux/AlmaLinux:
8181

8282
```bash
83-
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
83+
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock50_18
8484
```
8585

8686
For Ubuntu/Debian:
8787

8888
```bash
89-
sudo apt install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
89+
sudo apt install -y pgedge-postgresql-18 pgedge-postgresql-18-spock50
9090
```
9191

9292
On each node, initialize the PostgreSQL database cluster.

‎docs/internals-doc/specs/spock-monitor-design.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ the LSN alone is set for every transaction.
329329
## 8. Compatibility and upgrade
330330

331331
* The same SQL section is appended to `spock--6.0.0.sql` and to
332-
`spock--5.0.13--6.0.0.sql`. Every catalog column the views reference
332+
`spock--5.0.14--6.0.0.sql`. Every catalog column the views reference
333333
exists since 5.0.6, so an upgraded node ends with the same objects as a
334334
fresh install.
335335
* `spock.get_apply_worker_status()` is kept for existing callers, as a SQL

‎docs/logical_slot_failover.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -611,8 +611,8 @@ ALTER EXTENSION spock UPDATE TO '6.0.0';
611611
```
612612

613613
PostgreSQL walks the version chain (5.0.8 to 5.0.9 to 5.0.10 to 5.0.11 to
614-
5.0.12 to 5.0.13 to 6.0.0) and runs each step in order. The 5.0.13 to 6.0.0
615-
step calls
614+
5.0.12 to 5.0.13 to 5.0.14 to 6.0.0) and runs each step in order. The 5.0.14
615+
to 6.0.0 step calls
616616
`spock.slot_enable_failover()` for you.
617617

618618
`spock.slot_enable_failover()` behaves as follows:

‎docs/modify/pg_upgrade_rolling_tutorial.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,13 @@ our example. Finish all steps for one node before starting the next.
204204
For PostgreSQL 18 on RHEL, Rocky Linux, or AlmaLinux:
205205
206206
```bash
207-
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
207+
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock50_18
208208
```
209209
210210
On Ubuntu or Debian:
211211
212212
```bash
213-
sudo apt install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
213+
sudo apt install -y pgedge-postgresql-18 pgedge-postgresql-18-spock50
214214
```
215215
216216
`pg_upgrade` recreates the Spock extension in the new cluster at

‎docs/modify/zodan/zodan_rolling_pg_version_tutorial.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,13 +128,13 @@ Postgres](../../getting_started.md#install-pgedge-enterprise-postgres-recommende
128128
For PostgreSQL 18 on RHEL, Rocky Linux, or AlmaLinux:
129129

130130
```bash
131-
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
131+
sudo dnf install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock50_18
132132
```
133133

134134
On Ubuntu or Debian:
135135

136136
```bash
137-
sudo apt install -y pgedge-postgres18-server pgedge-postgres18-contrib pgedge-spock18
137+
sudo apt install -y pgedge-postgresql-18 pgedge-postgresql-18-spock50
138138
```
139139

140140
In our example, the replacement node runs on its own port on the same

‎docs/spock_functions/repset_mgmt.md‎

Lines changed: 36 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,33 @@ source of truth for three behaviours:
9696
that already has them would fail.
9797
- `block_in_repset`: a table in this schema, or belonging to this extension,
9898
may not be added to a replication set.
99-
- `replicate_ddl`: applies to schemas only. When `false`, AutoDDL keeps DDL
100-
targeting this schema node-local -- it runs where issued but is not shipped
101-
to other nodes. It is not meaningful for extensions, so it is required for
102-
`schema` rows and is `NULL` for `extension` rows (a `CHECK` enforces this,
103-
and `reserved_object_add` sets it to `NULL` automatically for an extension).
99+
- `replicate_ddl`: when `false`, AutoDDL keeps the object's DDL node-local
100+
-- it runs where issued but is not shipped to other nodes. The default is
101+
`true`.
104102

105-
Only DDL whose target schema Spock can identify is kept local: `CREATE`
103+
For an extension, `CREATE EXTENSION`, `ALTER EXTENSION`, `DROP
104+
EXTENSION`, `COMMENT ON EXTENSION` and `SECURITY LABEL ON EXTENSION` are
105+
kept local; run them on each node. A `DROP EXTENSION` that names both a
106+
node-local extension and a replicated one is refused while DDL replication
107+
is on; drop them in separate statements. `CREATE EXTENSION ... CASCADE` of
108+
a replicated extension that requires a node-local one is also refused, even
109+
when every required extension is already installed; create the node-local
110+
extension on each node first, then run the `CREATE EXTENSION` without
111+
`CASCADE`. `spock.replicate_ddl()` refuses all of these statements for a
112+
node-local extension. Whatever a statement on a node-local extension does
113+
with `CASCADE` also stays on the local node: objects that depend on the
114+
extension are dropped only there, and extensions that `CREATE EXTENSION
115+
... CASCADE` installs are installed only there.
116+
117+
A statement that removes a node-local extension without naming it is not
118+
caught: `DROP EXTENSION ... CASCADE` of an extension it requires, `DROP
119+
SCHEMA ... CASCADE` of a schema it was created in, or `DROP OWNED BY` its
120+
owner. Such a statement replicates, and each peer must then drop the
121+
node-local extension from its apply worker. Drop the node-local extension
122+
on each node first.
123+
124+
For a schema, only DDL whose target schema Spock can identify is kept
125+
local: `CREATE`
106126
`SCHEMA`/`TABLE`/`TABLE AS`/`SEQUENCE`/`VIEW`/`INDEX`, `ALTER TABLE`, and
107127
`DROP` of those object kinds. Other DDL against the schema (for example
108128
`GRANT`, `COMMENT`, `TRUNCATE`, or `ALTER ... SET SCHEMA`) is not classified
@@ -124,8 +144,11 @@ modified:
124144

125145
`spock`, `snowflake`, `lolor` and `coldfront` each have both a `schema` and an
126146
`extension` row. The `replicate_ddl` column above is the value on the
127-
`schema` row; the `extension` row carries `replicate_ddl = NULL` (not
128-
applicable), while `exclude_from_dump`/`block_in_repset` apply to both.
147+
`schema` row. The `extension` rows have `replicate_ddl = true` (replicated),
148+
except `lolor`, whose extension row is `false`: lolor refuses to be created
149+
or dropped by an apply worker, so `CREATE`, `ALTER` and `DROP EXTENSION
150+
lolor` are run on each node instead of being replicated.
151+
`exclude_from_dump`/`block_in_repset` apply to both rows.
129152

130153
`lolor` is excluded from the dump but is intentionally allowed in replication
131154
sets: its tables must replicate so that large objects survive a
@@ -383,7 +406,7 @@ changed.
383406

384407
`spock.reserved_object_add(p_name name, p_kind text, p_exclude_from_dump bool
385408
DEFAULT true, p_block_in_repset bool DEFAULT true, p_replicate_ddl bool
386-
DEFAULT NULL)`
409+
DEFAULT true)`
387410

388411
Parameters:
389412

@@ -393,11 +416,10 @@ Parameters:
393416
default is `true`.
394417
- `p_block_in_repset` blocks the object from replication sets; the default is
395418
`true`.
396-
- `p_replicate_ddl` applies to schemas only. For a schema, leaving it unset
397-
(`NULL`) defaults to `true`; pass `false` to keep the schema node-local so
398-
AutoDDL does not ship its DDL to other nodes (as `pgedge_ace` is). For
399-
`p_kind = 'extension'` the argument is ignored and the value is stored as
400-
`NULL`.
419+
- `p_replicate_ddl`: pass `false` to keep the object node-local so AutoDDL
420+
does not ship its DDL to other nodes (as `pgedge_ace` and the `lolor`
421+
extension are). The default is `true`, and an explicit `NULL` is taken as
422+
`true`.
401423

402424
### spock.reserved_object_remove
403425

0 commit comments

Comments
 (0)