pg_easy_replicate 0.1.4 → 0.1.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c253c57988226f7d90116cfc4276a51ac6a2753daea88169ba244fe4ce069e76
4
- data.tar.gz: cadca2e9e430f06be91ce4e1623fdf333fdc96edded99e83729f7b56e9356191
3
+ metadata.gz: f655d3bf7d458de6b84a85930e7175c05f780a390e9431531a0ae30c35d4737b
4
+ data.tar.gz: fa23c33715823598d4795ba64cbf466088d01fd97315bfe97d3a05db2da50f48
5
5
  SHA512:
6
- metadata.gz: dee2a8f5c96289076276b6d2f92e5e0623ac1c2ed7d885bfa7ab472bbc80fc525665fa72ed54fb772d63e9fd564acecea5c0a3d107dcb5e46370e539c20ab2ac
7
- data.tar.gz: b7c9c94cf5c5b9288a81e6d2a144f71cc387096b464f732f38755f293c1d7344120cf4107f1803981524773edd95cabfa34c56b973004dfd0efec69e9f066f8a
6
+ metadata.gz: 1e69d89ca00ca077784aab0c042e46c85faf7e15f2e585a65321084c5b3543502a7c9a440faa17f829848015a31ed50393129a0d7bfa083a27a731af4c179b68
7
+ data.tar.gz: ce29729ddcf74420818c0b4d86b98de28fbefd0690368ee4fcdd40f689dcf1ba6c3135850ab1e22de2bbd977c733ca5449cf42ccef728fda20c54b102b38f965
data/CHANGELOG.md CHANGED
@@ -1,3 +1,13 @@
1
+ ## [0.1.4] - 2023-06-22
2
+
3
+ - Drop lockbox dependency
4
+ - Support password with special chars and test for url encoded URI
5
+ - Support AWS and GCP special user scenarios and introduce `--special-user-role`
6
+
7
+ ## [0.1.3] - 2023-06-22
8
+
9
+ - Docker multi-platform image build support for linux/amd64 and linux/arm64 starting 0.1.3
10
+
1
11
  ## [0.1.2] - 2023-06-22
2
12
 
3
13
  - Keep the internal username unique
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- pg_easy_replicate (0.1.4)
4
+ pg_easy_replicate (0.1.5)
5
5
  ougai (~> 2.0.0)
6
6
  pg (~> 1.5.3)
7
7
  sequel (~> 5.69.0)
data/README.md CHANGED
@@ -15,7 +15,7 @@ Battle tested in production at [Tines](https://www.tines.com/) 🚀
15
15
  - [Replicating all tables with a single group](#replicating-all-tables-with-a-single-group)
16
16
  - [Config check](#config-check)
17
17
  - [Bootstrap](#bootstrap)
18
- - [Bootstrap and Config Check with special user role (AWS/GCP/Custom)](#bootstrap-and-config-check-with-special-user-role--aws-gcp-custom-)
18
+ - [Bootstrap and Config Check with special user role in AWS or GCP](#bootstrap-and-config-check-with-special-user-role-in-aws-or-gcp)
19
19
  - [Config Check](#config-check)
20
20
  - [Bootstrap](#bootstrap-1)
21
21
  - [Start sync](#start-sync)
@@ -120,7 +120,7 @@ $ pg_easy_replicate bootstrap --group-name database-cluster-1
120
120
  ...
121
121
  ```
122
122
 
123
- ### Bootstrap and Config Check with special user role (AWS/GCP/Custom)
123
+ ### Bootstrap and Config Check with special user role in AWS or GCP
124
124
 
125
125
  If you don't want your primary login user to have `superuser` privileges or you are on AWS or GCP, you will need to pass in the special user role that has the privileges to create role, schema, publication and subscription. This is required so `pg_easy_replicate` can create a dedicated user for replication which is granted the respective special user role to carry out its functionalities.
126
126
 
data/bin/release.sh CHANGED
@@ -1,3 +1,7 @@
1
+ #!/bin/bash
2
+
3
+ set -euo pipefail
4
+
1
5
  export VERSION=$1
2
6
  echo "VERSION: ${VERSION}"
3
7
 
data/bin/test.sh ADDED
@@ -0,0 +1,28 @@
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
@@ -12,7 +12,7 @@ module PgEasyReplicate
12
12
  aliases: "-s",
13
13
  desc:
14
14
  "Name of the role that has superuser permissions. Usually useful for AWS (rds_superuser) or GCP (cloudsqlsuperuser)."
15
- def config_check(options)
15
+ def config_check
16
16
  PgEasyReplicate.assert_config(
17
17
  special_user_role: options[:special_user_role],
18
18
  )
@@ -81,7 +81,7 @@ module PgEasyReplicate
81
81
  required: true,
82
82
  desc: "Name of the group previously provisioned"
83
83
  def stop_sync
84
- PgEasyReplicate::Orchestrate.stop_sync(options[:group_name])
84
+ PgEasyReplicate::Orchestrate.stop_sync(group_name: options[:group_name])
85
85
  end
86
86
 
87
87
  desc "switchover ",
@@ -169,7 +169,11 @@ module PgEasyReplicate
169
169
  raise "Unable to drop subscription: #{e.message}"
170
170
  end
171
171
 
172
- def stop_sync(target_conn_string:, source_conn_string:, group_name:)
172
+ def stop_sync(
173
+ group_name:,
174
+ source_conn_string: source_db_url,
175
+ target_conn_string: target_db_url
176
+ )
173
177
  logger.info(
174
178
  "Stopping sync",
175
179
  {
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PgEasyReplicate
4
- VERSION = "0.1.4"
4
+ VERSION = "0.1.5"
5
5
  end
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
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shayon Mukherjee
@@ -242,6 +242,7 @@ executables:
242
242
  - pg_easy_replicate
243
243
  - pg_easy_replicate_console
244
244
  - release.sh
245
+ - test.sh
245
246
  extensions: []
246
247
  extra_rdoc_files: []
247
248
  files:
@@ -260,6 +261,7 @@ files:
260
261
  - bin/pg_easy_replicate
261
262
  - bin/pg_easy_replicate_console
262
263
  - bin/release.sh
264
+ - bin/test.sh
263
265
  - docker-compose.yml
264
266
  - lib/pg_easy_replicate.rb
265
267
  - lib/pg_easy_replicate/cli.rb