Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb29a183

Browse files
committed
Fix logical decoding regression tests to correctly check slot existence.
The regression tests for logical decoding verify whether a logical slotexists or has been dropped. Previously, these tests attempted toretrieve "slot_name" from the result of slot(), but since "slot_name" wasnot included in the result, slot()->{'slot_name'} always returned undef,leading to incorrect behavior.This commit fixes the issue by checking the "plugin" field in the resultof slot() instead, ensuring the tests properly verify slot existence.Back-patch to all supported versions.Author: Hayato Kuroda <kuroda.hayato@fujitsu.com>Reviewed-by: Fujii Masao <masao.fujii@gmail.com>Discussion:https://postgr.es/m/OSCPR01MB149667EC4E738769CA80B7EA5F5AE2@OSCPR01MB14966.jpnprd01.prod.outlook.comBackpatch-through: 13
1 parent186c586 commitb29a183

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

‎src/test/recovery/t/006_logical_decoding.pl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@
144144
is($node_master->psql('postgres','DROP DATABASE otherdb'),
145145
3,'dropping a DB with active logical slots fails');
146146
$pg_recvlogical->kill_kill;
147-
is($node_master->slot('otherdb_slot')->{'slot_name'},
148-
undef,'logical slot still exists');
147+
is($node_master->slot('otherdb_slot')->{'plugin'},
148+
'test_decoding','logical slot still exists');
149149
}
150150

151151
$node_master->poll_query_until('otherdb',
@@ -154,8 +154,8 @@
154154

155155
is($node_master->psql('postgres','DROP DATABASE otherdb'),
156156
0,'dropping a DB with inactive logical slots succeeds');
157-
is($node_master->slot('otherdb_slot')->{'slot_name'},
158-
undef,'logical slot was actually dropped with DB');
157+
is($node_master->slot('otherdb_slot')->{'plugin'},
158+
'','logical slot was actually dropped with DB');
159159

160160
# Test logical slot advancing and its durability.
161161
my$logical_slot ='logical_slot';

‎src/test/recovery/t/010_logical_decoding_timelines.pl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@
9090
'postgres',q[SELECT 1 FROM pg_database WHERE datname = 'dropme']),
9191
'',
9292
'dropped DB dropme on standby');
93-
is($node_master->slot('dropme_slot')->{'slot_name'},
94-
undef,'logical slot was actually dropped on standby');
93+
is($node_master->slot('dropme_slot')->{'plugin'},
94+
'','logical slot was actually dropped on standby');
9595

9696
# Back to testing failover...
9797
$node_master->safe_psql('postgres',

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp