pgoutput-client 0.2.2 → 0.2.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f4b5412d12b81f8e787d00975419c7478af45fb47d0fa0f616876a9141f47396
4
- data.tar.gz: 9a77f1cbb0c438312fdefa4045f89f2359829751a96e6131f20ffc9ce4ccc6b2
3
+ metadata.gz: a375cce8bbb2d330974bfd22bdc0a7542c1c1ed5fe73f448e41bba717532aac2
4
+ data.tar.gz: 3c20c8e182548d5556d4a8a503a92d2d8c89d5c926a59eaaf537812d4bb5cdca
5
5
  SHA512:
6
- metadata.gz: e067f71e70ade6f7cf25d543edbfac7f79058e6a8b79a35457a6320365e574d7c8c12ecbdecd74355eff1aa641eabde1c926e74dc52513e7a1ad101461a7375d
7
- data.tar.gz: e66ed2183b869dc7074595fc2509763d5da468ddd7f21a5ed10617990405da21b720df5131de01771beaed5532970073eed56bbbd1517a40bb271019b34f8af9
6
+ metadata.gz: 78fc7ede75ae5fcd4b27adddef61d1f6b59ba8a26943bb44bf93d0dc5f2d97a477f36d12ec935fdf083792cbc8d37418e0b2a9f84fb7d14d15aa7e5847f8d2fd
7
+ data.tar.gz: 58ea9e8475789846b3caad462fcfef693df07ad8ef9cf724e877f38ba2ca53a73b3e1476971a7b5b1c9ad47bb0b8c20fae2e31f47674a377bf03c7d09cb1533c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 0.2.3 - 2026-06-17
6
+
7
+ ### Fixed
8
+
9
+ * Fixed automatic replication slot creation when `auto_create_slot` is enabled.
10
+ * Fixed startup failure when the configured replication slot already exists.
11
+ * Improved logical replication restart behavior for persistent replication slots.
12
+ * Improved lifecycle management of existing replication slots across process and container restarts.
13
+
14
+ ### Changed
15
+
16
+ * `auto_create_slot` now follows **ensure slot exists** semantics.
17
+ * Existing replication slots are treated as valid and reusable when automatic slot creation is enabled.
18
+ * Slot creation remains automatic for missing slots and idempotent for existing slots.
19
+
20
+ ### Internal
21
+
22
+ * Hardened replication slot lifecycle handling.
23
+ * Expanded coverage around automatic slot creation scenarios.
24
+ * Updated signatures and tests for slot creation behavior.
25
+
26
+
5
27
  ## 0.2.2 - 2026-06-17
6
28
 
7
29
  ### Added
@@ -194,14 +194,24 @@ module Pgoutput
194
194
  private
195
195
 
196
196
  def setup_connection(connection)
197
- if configuration.auto_create_slot && !@slot_created
198
- connection.create_replication_slot
199
- @slot_created = true
200
- end
197
+ ensure_replication_slot(connection) if configuration.auto_create_slot && !@slot_created
201
198
 
202
199
  connection.start_replication
203
200
  end
204
201
 
202
+ def ensure_replication_slot(connection)
203
+ connection.create_replication_slot
204
+ @slot_created = true
205
+ rescue ConnectionError => e
206
+ raise unless replication_slot_already_exists?(e)
207
+
208
+ @slot_created = true
209
+ end
210
+
211
+ def replication_slot_already_exists?(error)
212
+ error.message.match?(/replication slot .* already exists/i)
213
+ end
214
+
205
215
  def run_stream_cycle(configuration, &block)
206
216
  connection = Connection.open(configuration)
207
217
  setup_connection(connection)
@@ -5,6 +5,6 @@ module Pgoutput
5
5
  # Current pgoutput-client gem version.
6
6
  #
7
7
  # @return [String]
8
- VERSION = "0.2.2"
8
+ VERSION = "0.2.3"
9
9
  end
10
10
  end
@@ -83,6 +83,10 @@ module Pgoutput
83
83
 
84
84
  def setup_connection: (untyped connection) -> untyped
85
85
 
86
+ def ensure_replication_slot: (untyped connection) -> untyped
87
+
88
+ def replication_slot_already_exists?: (untyped error) -> bool
89
+
86
90
  def run_stream_cycle: (untyped configuration) { (?) -> untyped } -> untyped
87
91
 
88
92
  def configuration_for_resume: () -> untyped
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pgoutput-client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ken C. Demanawa