-
Notifications
You must be signed in to change notification settings - Fork 312
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
25 changed files
with
297 additions
and
578 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: '2.1' | ||
version: '3.9' | ||
volumes: | ||
default-pg-data-dir: | ||
new-pg-data-dir: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: '2.1' | ||
version: '3.9' | ||
volumes: | ||
default-pg-data-dir: | ||
new-pg-data-dir: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
services: | ||
pg: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
version: '2.1' | ||
version: '3.9' | ||
volumes: | ||
default-pg-data-dir-md5: | ||
new-pg-data-dir: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
volumes: | ||
pg-publisher-data-dir: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
volumes: | ||
pg-publisher-data-dir: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
volumes: | ||
pg-db-data-dir: | ||
|
62 changes: 62 additions & 0 deletions
62
scenario_tests/streaming_replication/docker-compose-gs-promote.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
|
||
version: '2.1' | ||
|
||
volumes: | ||
pg-master-data-dir: | ||
pg-node-data-dir: | ||
|
||
services: | ||
pg-master: | ||
image: 'kartoza/postgis:${TAG:-manual-build}' | ||
restart: 'always' | ||
|
||
volumes: | ||
- pg-master-data-dir:/var/lib/postgresql | ||
- ./tests:/tests | ||
- ../utils:/lib/utils | ||
- ./scripts/setup-master.sql:/docker-entrypoint-initdb.d/setup-master.sql | ||
environment: | ||
|
||
ALLOW_IP_RANGE: '0.0.0.0/0' | ||
|
||
# We can specify optional credentials | ||
POSTGRES_PASS: 'docker' | ||
REPLICATION_USER: 'replicator' | ||
REPLICATION_PASS: 'replicator' | ||
REPLICATION: 'true' | ||
RUN_AS_ROOT: false | ||
healthcheck: | ||
interval: 60s | ||
timeout: 30s | ||
retries: 3 | ||
test: "pg_isready" | ||
|
||
pg-node: | ||
image: 'kartoza/postgis:${TAG:-manual-build}' | ||
restart: 'always' | ||
|
||
volumes: | ||
- pg-node-data-dir:/var/lib/postgresql | ||
- ./tests:/tests | ||
- ../utils:/lib/utils | ||
|
||
environment: | ||
|
||
ALLOW_IP_RANGE: '0.0.0.0/0' | ||
POSTGRES_PASS: 'docker' | ||
REPLICATE_FROM: 'pg-master' | ||
REPLICATION: 'true' | ||
RUN_AS_ROOT: false | ||
PROMOTE_MASTER: false | ||
DESTROY_DATABASE_ON_RESTART: 'True' | ||
REPLICATION_USER: 'replicator' | ||
REPLICATION_PASS: 'replicator' | ||
depends_on: | ||
pg-master: | ||
condition: service_healthy | ||
|
||
healthcheck: | ||
interval: 60s | ||
timeout: 30s | ||
retries: 3 | ||
test: "pg_isready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
volumes: | ||
pg-master-data-dir: | ||
|
55 changes: 55 additions & 0 deletions
55
scenario_tests/streaming_replication/docker-compose-root-promote.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
|
||
version: '2.1' | ||
|
||
volumes: | ||
pg-master-data-dir: | ||
pg-node-data-dir: | ||
|
||
services: | ||
pg-master: | ||
image: 'kartoza/postgis:${TAG:-manual-build}' | ||
restart: 'always' | ||
volumes: | ||
- pg-master-data-dir:/var/lib/postgresql | ||
- ./tests:/tests | ||
- ../utils:/lib/utils | ||
- ./scripts/setup-master.sql:/docker-entrypoint-initdb.d/setup-master.sql | ||
environment: | ||
ALLOW_IP_RANGE: '0.0.0.0/0' | ||
# We can specify optional credentials | ||
POSTGRES_PASS: 'docker' | ||
REPLICATION_USER: 'replicator' | ||
REPLICATION_PASS: 'replicator' | ||
REPLICATION: 'true' | ||
RUN_AS_ROOT: true | ||
healthcheck: | ||
interval: 60s | ||
timeout: 30s | ||
retries: 3 | ||
test: "pg_isready" | ||
|
||
pg-node: | ||
image: 'kartoza/postgis:${TAG:-manual-build}' | ||
restart: 'always' | ||
volumes: | ||
- pg-node-data-dir:/var/lib/postgresql | ||
- ./tests:/tests | ||
- ../utils:/lib/utils | ||
environment: | ||
ALLOW_IP_RANGE: '0.0.0.0/0' | ||
POSTGRES_PASS: 'docker' | ||
REPLICATE_FROM: 'pg-master' | ||
REPLICATION: 'true' | ||
RUN_AS_ROOT: true | ||
PROMOTE_MASTER: false | ||
DESTROY_DATABASE_ON_RESTART: 'True' | ||
REPLICATION_USER: 'replicator' | ||
REPLICATION_PASS: 'replicator' | ||
depends_on: | ||
pg-master: | ||
condition: service_healthy | ||
healthcheck: | ||
interval: 60s | ||
timeout: 30s | ||
retries: 3 | ||
test: "pg_isready" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
|
||
version: '2.1' | ||
version: '3.9' | ||
|
||
volumes: | ||
pg-master-data-dir: | ||
|
11 changes: 11 additions & 0 deletions
11
scenario_tests/streaming_replication/scripts/setup-master.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Create a table | ||
CREATE TABLE IF NOT EXISTS sweets | ||
( | ||
id SERIAL, | ||
name TEXT, | ||
price DECIMAL, | ||
CONSTRAINT sweets_pkey PRIMARY KEY (id) | ||
); | ||
|
||
-- Inserts records into the table | ||
INSERT INTO sweets (name, price) VALUES ('strawberry', 4.50), ('Coffee', 6.20), ('lollipop', 3.80); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
13 changes: 13 additions & 0 deletions
13
scenario_tests/streaming_replication/tests/test_node_promotion.sh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#!/usr/bin/env bash | ||
|
||
set -e | ||
|
||
source /scripts/env-data.sh | ||
|
||
# execute tests | ||
pushd /tests | ||
|
||
PGHOST=localhost \ | ||
PGDATABASE=gis \ | ||
PYTHONPATH=/lib \ | ||
python3 -m unittest -v test_replication.TestReplicationPromotion |
Oops, something went wrong.