pgoutput-client 0.2.1 → 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 +4 -4
- data/CHANGELOG.md +65 -0
- data/lib/pgoutput/client/runner.rb +21 -8
- data/lib/pgoutput/client/stream.rb +1 -0
- data/lib/pgoutput/client/version.rb +1 -1
- data/sig/pgoutput/client/runner.rbs +5 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a375cce8bbb2d330974bfd22bdc0a7542c1c1ed5fe73f448e41bba717532aac2
|
|
4
|
+
data.tar.gz: 3c20c8e182548d5556d4a8a503a92d2d8c89d5c926a59eaaf537812d4bb5cdca
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 78fc7ede75ae5fcd4b27adddef61d1f6b59ba8a26943bb44bf93d0dc5f2d97a477f36d12ec935fdf083792cbc8d37418e0b2a9f84fb7d14d15aa7e5847f8d2fd
|
|
7
|
+
data.tar.gz: 58ea9e8475789846b3caad462fcfef693df07ad8ef9cf724e877f38ba2ca53a73b3e1476971a7b5b1c9ad47bb0b8c20fae2e31f47674a377bf03c7d09cb1533c
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,71 @@
|
|
|
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
|
+
|
|
27
|
+
## 0.2.2 - 2026-06-17
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
|
|
31
|
+
* Added periodic standby status feedback while replication streams are idle.
|
|
32
|
+
* Added E2E coverage for PostgreSQL restart and replication recovery.
|
|
33
|
+
* Added E2E validation of replication slot resume behavior after reconnect.
|
|
34
|
+
* Added test coverage for idle replication streams.
|
|
35
|
+
|
|
36
|
+
### Changed
|
|
37
|
+
|
|
38
|
+
* Increased reconnect retry budget to better tolerate PostgreSQL restart windows.
|
|
39
|
+
* Improved replication stream resilience during transient PostgreSQL outages.
|
|
40
|
+
* Improved reconnect behavior when PostgreSQL is starting up and temporarily rejecting connections.
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
* Fixed replication timeout during idle logical replication streams.
|
|
45
|
+
|
|
46
|
+
* Fixed walsender termination caused by missing standby feedback during periods without WAL activity.
|
|
47
|
+
|
|
48
|
+
* Fixed reconnect handling after PostgreSQL restart.
|
|
49
|
+
|
|
50
|
+
* Fixed connection recovery when PostgreSQL reports:
|
|
51
|
+
|
|
52
|
+
```
|
|
53
|
+
FATAL: the database system is starting up
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
* Fixed E2E PostgreSQL test infrastructure and restart recovery validation.
|
|
57
|
+
|
|
58
|
+
* Fixed test isolation between unit and E2E PostgreSQL connection paths.
|
|
59
|
+
|
|
60
|
+
### Internal
|
|
61
|
+
|
|
62
|
+
* Expanded transport lifecycle validation.
|
|
63
|
+
* Improved operational reliability of long-running replication sessions.
|
|
64
|
+
|
|
65
|
+
|
|
66
|
+
## [0.2.1] - 2026-06-16
|
|
67
|
+
|
|
68
|
+
- Gemspec summary and description improvement release only
|
|
69
|
+
|
|
5
70
|
## [0.2.0] - 2026-06-16
|
|
6
71
|
|
|
7
72
|
### Fixed
|
|
@@ -37,7 +37,7 @@ module Pgoutput
|
|
|
37
37
|
# @see Stream
|
|
38
38
|
# @api public
|
|
39
39
|
class Runner
|
|
40
|
-
DEFAULT_RECONNECT_ATTEMPTS =
|
|
40
|
+
DEFAULT_RECONNECT_ATTEMPTS = 30
|
|
41
41
|
DEFAULT_RECONNECT_BACKOFF = 0.5
|
|
42
42
|
|
|
43
43
|
# Configuration used by this runner.
|
|
@@ -70,6 +70,7 @@ module Pgoutput
|
|
|
70
70
|
@resume_lsn = configuration.start_lsn
|
|
71
71
|
@acked_lsn = configuration.start_lsn
|
|
72
72
|
@slot_created = false
|
|
73
|
+
@connected_once = false
|
|
73
74
|
@last_error = nil
|
|
74
75
|
@reconnect_attempts = 0
|
|
75
76
|
end
|
|
@@ -193,26 +194,38 @@ module Pgoutput
|
|
|
193
194
|
private
|
|
194
195
|
|
|
195
196
|
def setup_connection(connection)
|
|
196
|
-
if configuration.auto_create_slot && !@slot_created
|
|
197
|
-
connection.create_replication_slot
|
|
198
|
-
@slot_created = true
|
|
199
|
-
end
|
|
197
|
+
ensure_replication_slot(connection) if configuration.auto_create_slot && !@slot_created
|
|
200
198
|
|
|
201
199
|
connection.start_replication
|
|
202
200
|
end
|
|
203
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
|
+
|
|
204
215
|
def run_stream_cycle(configuration, &block)
|
|
205
216
|
connection = Connection.open(configuration)
|
|
206
217
|
setup_connection(connection)
|
|
218
|
+
@connected_once = true
|
|
207
219
|
@stream = Stream.new(connection:, configuration:, acked_lsn: @acked_lsn)
|
|
208
220
|
@stream.start(&block)
|
|
209
221
|
:done
|
|
210
222
|
rescue ConnectionError => e
|
|
211
223
|
@last_error = e
|
|
212
|
-
raise if @stopped
|
|
224
|
+
raise if @stopped
|
|
225
|
+
raise if @stream.nil? && !@connected_once
|
|
213
226
|
|
|
214
|
-
@resume_lsn = @stream
|
|
215
|
-
@acked_lsn = @stream
|
|
227
|
+
@resume_lsn = @stream&.latest_lsn || @resume_lsn
|
|
228
|
+
@acked_lsn = @stream&.acked_lsn || @acked_lsn
|
|
216
229
|
:retry
|
|
217
230
|
ensure
|
|
218
231
|
@stream = nil
|
|
@@ -53,7 +53,7 @@ module Pgoutput
|
|
|
53
53
|
|
|
54
54
|
@reconnect_attempts: untyped
|
|
55
55
|
|
|
56
|
-
DEFAULT_RECONNECT_ATTEMPTS:
|
|
56
|
+
DEFAULT_RECONNECT_ATTEMPTS: 30
|
|
57
57
|
|
|
58
58
|
DEFAULT_RECONNECT_BACKOFF: ::Float
|
|
59
59
|
|
|
@@ -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
|