pg_easy_replicate 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/pg_easy_replicate/orchestrate.rb +6 -5
- data/lib/pg_easy_replicate/version.rb +1 -1
- data/scripts/e2e-bootstrap.sh +19 -0
- data/scripts/e2e-start.sh +18 -0
- metadata +4 -5
- data/bin/test.sh +0 -28
- /data/{bin → scripts}/release.sh +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ba133c0e80239fb125f32daa490fd20efe18c3f7391291d8465a8688fb3c0caf
|
4
|
+
data.tar.gz: f5c1780f43b621ddf4a8359d7dd3131291f42fe064cbd131b1b49308f0bc041e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b1d9e43d36d98b1cfe1e992123783f3adb160851acbc60447b77b7fba244dfbb1bf219686759b93619a9ac682813a24449bd4ddb3fea5c09f9990f6276b04ca9
|
7
|
+
data.tar.gz: 68d31a389a1ff11a5e30bbe48b6ab9ebd746adf2a2787c18388627e08c8cd8c2dbaa289e1f898ab2a119b7da2a3e72df92a88a6826504c2438fa6a1cd6e7348e
|
data/.rspec
CHANGED
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
@@ -18,7 +18,7 @@ module PgEasyReplicate
|
|
18
18
|
group_name: options[:group_name],
|
19
19
|
tables: options[:tables],
|
20
20
|
conn_string: source_db_url,
|
21
|
-
schema: options[:
|
21
|
+
schema: options[:schema_name],
|
22
22
|
)
|
23
23
|
|
24
24
|
create_subscription(
|
@@ -30,7 +30,7 @@ module PgEasyReplicate
|
|
30
30
|
Group.create(
|
31
31
|
name: options[:group_name],
|
32
32
|
table_names: options[:tables],
|
33
|
-
schema_name: options[:
|
33
|
+
schema_name: options[:schema_name],
|
34
34
|
started_at: Time.now.utc,
|
35
35
|
)
|
36
36
|
rescue => e
|
@@ -46,7 +46,7 @@ module PgEasyReplicate
|
|
46
46
|
Group.create(
|
47
47
|
name: options[:group_name],
|
48
48
|
table_names: options[:tables],
|
49
|
-
schema_name: options[:
|
49
|
+
schema_name: options[:schema_name],
|
50
50
|
started_at: Time.now.utc,
|
51
51
|
failed_at: Time.now.utc,
|
52
52
|
)
|
@@ -80,6 +80,7 @@ module PgEasyReplicate
|
|
80
80
|
"Adding tables up publication",
|
81
81
|
{ publication_name: publication_name(group_name) },
|
82
82
|
)
|
83
|
+
|
83
84
|
tables = tables&.split(",") || []
|
84
85
|
unless tables.size > 0
|
85
86
|
tables = list_all_tables(schema: schema, conn_string: conn_string)
|
@@ -197,11 +198,11 @@ module PgEasyReplicate
|
|
197
198
|
group_name:,
|
198
199
|
source_conn_string: source_db_url,
|
199
200
|
target_conn_string: target_db_url,
|
200
|
-
lag_delta_size:
|
201
|
+
lag_delta_size: nil
|
201
202
|
)
|
202
203
|
group = Group.find(group_name)
|
203
204
|
|
204
|
-
watch_lag(group_name: group_name, lag: lag_delta_size)
|
205
|
+
watch_lag(group_name: group_name, lag: lag_delta_size || DEFAULT_LAG)
|
205
206
|
revoke_connections_on_source_db(group_name)
|
206
207
|
wait_for_remaining_catchup(group_name)
|
207
208
|
refresh_sequences(
|
@@ -0,0 +1,19 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eo pipefail
|
4
|
+
|
5
|
+
if [[ -z ${GITHUB_WORKFLOW} ]]; then
|
6
|
+
export SECONDARY_SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@source_db/postgres"
|
7
|
+
fi
|
8
|
+
|
9
|
+
export SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5432/postgres"
|
10
|
+
export TARGET_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5433/postgres"
|
11
|
+
export PGPASSWORD='jamesbond123@7!'"'"'3aaR'
|
12
|
+
|
13
|
+
pgbench --initialize -s 5 --foreign-keys --host localhost -U jamesbond -d postgres
|
14
|
+
|
15
|
+
pg_dump --schema-only --host localhost -U jamesbond -d postgres >schema.sql
|
16
|
+
cat schema.sql | psql --host localhost -U jamesbond -d postgres -p 5433
|
17
|
+
rm schema.sql
|
18
|
+
|
19
|
+
bundle exec bin/pg_easy_replicate config_check
|
@@ -0,0 +1,18 @@
|
|
1
|
+
#!/bin/bash
|
2
|
+
|
3
|
+
set -eo pipefail
|
4
|
+
|
5
|
+
if [[ -z ${GITHUB_WORKFLOW} ]]; then
|
6
|
+
export SECONDARY_SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@source_db/postgres"
|
7
|
+
fi
|
8
|
+
|
9
|
+
export SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5432/postgres"
|
10
|
+
export TARGET_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5433/postgres"
|
11
|
+
export PGPASSWORD='jamesbond123@7!'"'"''"'"'3aaR'
|
12
|
+
|
13
|
+
# Bootstrap and cleanup
|
14
|
+
echo "===== Performing Bootstrap and cleanup"
|
15
|
+
bundle exec bin/pg_easy_replicate bootstrap -g cluster-1
|
16
|
+
bundle exec bin/pg_easy_replicate start_sync -g cluster-1 -s public
|
17
|
+
bundle exec bin/pg_easy_replicate stats -g cluster-1
|
18
|
+
bundle exec bin/pg_easy_replicate switchover -g cluster-1
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_easy_replicate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Shayon Mukherjee
|
@@ -241,8 +241,6 @@ email:
|
|
241
241
|
executables:
|
242
242
|
- pg_easy_replicate
|
243
243
|
- pg_easy_replicate_console
|
244
|
-
- release.sh
|
245
|
-
- test.sh
|
246
244
|
extensions: []
|
247
245
|
extra_rdoc_files: []
|
248
246
|
files:
|
@@ -260,8 +258,6 @@ files:
|
|
260
258
|
- Rakefile
|
261
259
|
- bin/pg_easy_replicate
|
262
260
|
- bin/pg_easy_replicate_console
|
263
|
-
- bin/release.sh
|
264
|
-
- bin/test.sh
|
265
261
|
- docker-compose.yml
|
266
262
|
- lib/pg_easy_replicate.rb
|
267
263
|
- lib/pg_easy_replicate/cli.rb
|
@@ -272,6 +268,9 @@ files:
|
|
272
268
|
- lib/pg_easy_replicate/stats.rb
|
273
269
|
- lib/pg_easy_replicate/version.rb
|
274
270
|
- package.json
|
271
|
+
- scripts/e2e-bootstrap.sh
|
272
|
+
- scripts/e2e-start.sh
|
273
|
+
- scripts/release.sh
|
275
274
|
- yarn.lock
|
276
275
|
homepage: https://github.com/shayonj/pg_easy_replicate
|
277
276
|
licenses:
|
data/bin/test.sh
DELETED
@@ -1,28 +0,0 @@
|
|
1
|
-
#!/bin/bash
|
2
|
-
|
3
|
-
set -euo pipefail
|
4
|
-
|
5
|
-
export SECONDARY_SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@source_db/postgres"
|
6
|
-
export SOURCE_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5432/postgres"
|
7
|
-
export TARGET_DB_URL="postgres://jamesbond:jamesbond123%407%21%273aaR@localhost:5433/postgres"
|
8
|
-
|
9
|
-
bundle exec bin/pg_easy_replicate config_check
|
10
|
-
|
11
|
-
# Bootstrap and cleanup
|
12
|
-
echo "===== Performing Bootstrap and cleanup"
|
13
|
-
bundle exec bin/pg_easy_replicate bootstrap -g cluster-1
|
14
|
-
bundle exec bin/pg_easy_replicate cleanup -e -g cluster-1
|
15
|
-
|
16
|
-
# Bootstrap and start_sync
|
17
|
-
echo "===== Performing Bootstrap, start_sync, stop_sync and cleanup"
|
18
|
-
bundle exec bin/pg_easy_replicate bootstrap -g cluster-1
|
19
|
-
bundle exec bin/pg_easy_replicate start_sync -g cluster-1
|
20
|
-
bundle exec bin/pg_easy_replicate stop_sync -g cluster-1
|
21
|
-
bundle exec bin/pg_easy_replicate cleanup -e -g cluster-1
|
22
|
-
|
23
|
-
# Bootstrap with switchover
|
24
|
-
echo "===== Performing Bootstrap, start_sync, stop_sync and cleanup"
|
25
|
-
bundle exec bin/pg_easy_replicate bootstrap -g cluster-1
|
26
|
-
bundle exec bin/pg_easy_replicate start_sync -g cluster-1
|
27
|
-
# bundle exec bin/pg_easy_replicate switchover -g cluster-1
|
28
|
-
bundle exec bin/pg_easy_replicate cleanup -e -g cluster-1
|
/data/{bin → scripts}/release.sh
RENAMED
File without changes
|