Skip to content

Commit b45836d

Browse files
fanfuxiaoranweinan003
authored andcommitted
Fix hot_standby isolation2 and regress tests
1 parent 88c96ac commit b45836d

File tree

7 files changed

+111
-101
lines changed

7 files changed

+111
-101
lines changed

src/test/isolation2/expected/hot_standby/basic.out

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@
2323
-- Test: basic query dispatch
2424
----------------------------------------------------------------
2525
create table hs_t1(a int);
26-
CREATE TABLE
26+
CREATE
2727
create table hs_t2(a int);
28-
CREATE TABLE
28+
CREATE
2929

3030
-- standby should see the results for 2pc immediately.
3131
insert into hs_t1 select * from generate_series(1,10);
32-
INSERT 0 10
32+
INSERT 10
3333
-1S: select * from hs_t1;
3434
a
3535
----
@@ -49,14 +49,14 @@ INSERT 0 10
4949
-- as long as another 2pc comes it will be able to see the previous 1pc. Wee
5050
-- tolerate this case in the mirrored cluster setup.
5151
insert into hs_t2 values(1);
52-
INSERT 0 1
52+
INSERT 1
5353
-1S: select * from hs_t2;
5454
a
5555
---
5656
(0 rows)
5757
-- any following 2pc will make the 1pc visible
5858
create temp table tt(a int);
59-
CREATE TABLE
59+
CREATE
6060
-1S: select * from hs_t2;
6161
a
6262
---
@@ -115,7 +115,7 @@ CREATE TABLE
115115
begin;
116116
BEGIN
117117
insert into hs_t1 select * from generate_series(11,20);
118-
INSERT 0 10
118+
INSERT 10
119119

120120
-- standby should only see 1...10
121121
-1S: select * from hs_t1;
@@ -134,7 +134,7 @@ INSERT 0 10
134134
(10 rows)
135135

136136
end;
137-
COMMIT
137+
END
138138

139139
-- standby should see 1...20 now
140140
-1S: select * from hs_t1;
@@ -224,9 +224,9 @@ ERROR: cannot execute VACUUM during recovery
224224
-- No hintbit WAL generation in SELECT.
225225
--
226226
create table hs_nohintbit(a int) distributed by (a);
227-
CREATE TABLE
227+
CREATE
228228
insert into hs_nohintbit select generate_series (1, 10);
229-
INSERT 0 10
229+
INSERT 10
230230
-- flush the data to disk
231231
checkpoint;
232232
CHECKPOINT

src/test/isolation2/expected/hot_standby/faults.out

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@
1818
(exited with code 0)
1919

2020
create table hs_failover(a int);
21-
CREATE TABLE
21+
CREATE
2222
insert into hs_failover select * from generate_series(1,10);
23-
INSERT 0 10
23+
INSERT 10
2424
-1S: select * from hs_failover;
2525
a
2626
----
@@ -47,7 +47,7 @@ select pg_ctl(datadir, 'stop', 'immediate') from gp_segment_configuration where
4747

4848
-- make sure mirror is detected down
4949
create temp table hs_tt(a int);
50-
CREATE TABLE
50+
CREATE
5151
select gp_request_fts_probe_scan();
5252
gp_request_fts_probe_scan
5353
---------------------------
@@ -137,10 +137,9 @@ HINT: Exit the current session and re-connect.
137137
-- will fail due to downed mirror (previous primary)
138138
-1S: select * from hs_failover;
139139
ERROR: failed to acquire resources on one or more segments
140-
DETAIL: could not connect to server: Connection refused
141-
Is the server running on host "127.0.1.1" and accepting
142-
TCP/IP connections on port 7003?
143-
(seg1 127.0.1.1:7003)
140+
DETAIL: connection to server at "10.13.9.74", port 7003 failed: Connection refused
141+
Is the server running on that host and accepting TCP/IP connections?
142+
(seg1 10.13.9.74:7003)
144143
-1Sq: ... <quitting>
145144

146145
-- bring the downed mirror up
@@ -219,7 +218,7 @@ select wait_until_all_segments_synchronized();
219218
(1 row)
220219

221220
1: create table tt_hs_dtx(a int);
222-
CREATE TABLE
221+
CREATE
223222

224223
-- inject fault to repeatedly fail the COMMIT PREPARE phase of 2PC, which ensures that the dtx cannot finish even by the dtx recovery process.
225224
select gp_inject_fault_infinite('finish_commit_prepared', 'error', dbid) from gp_segment_configuration where content=1 and role='p';

0 commit comments

Comments
 (0)