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

Commit50d764e

Browse files
committed
Bugfixes:
1. Increase stability of the pgbench test.2. Open subsidiary AQO relations more carefully.
1 parent8615038 commit50d764e

File tree

2 files changed

+14
-6
lines changed

2 files changed

+14
-6
lines changed

‎storage.c‎

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,8 @@ open_aqo_relation(char *heaprelnspname, char *heaprelname,
5252
char*indrelname,LOCKMODElockmode,
5353
Relation*hrel,Relation*irel)
5454
{
55-
Oidreloid;
56-
RangeVar*rv;
55+
Oidreloid;
56+
RangeVar*rv;
5757

5858
reloid=RelnameGetRelid(indrelname);
5959
if (!OidIsValid(reloid))
@@ -64,7 +64,10 @@ open_aqo_relation(char *heaprelnspname, char *heaprelname,
6464
if (*hrel==NULL)
6565
gotocleanup;
6666

67-
*irel=index_open(reloid,lockmode);
67+
/* Try to open index relation carefully. */
68+
*irel=try_relation_open(reloid,lockmode);
69+
if (*irel==NULL)
70+
gotocleanup;
6871
return true;
6972

7073
cleanup:

‎t/001_pgbench.pl‎

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,10 @@
109109
(SELECT count(aid) AS x FROM pgbench_accounts GROUP BY abalance HAVING abalance < :border) AS q1
110110
WHERE pgbb.bid = q1.x;
111111
});
112+
113+
# Avoid problems with an error fluctuations during the test above.
114+
$node->safe_psql('postgres',"TRUNCATE aqo_query_stat");
115+
112116
# Look for top of problematic queries.
113117
$node->command_ok(['pgbench','-t',"10",'-c',"$CLIENTS",'-j',"$THREADS",
114118
'-f',"$analytics" ],
@@ -127,7 +131,7 @@
127131
$res =$node->safe_psql('postgres',
128132
"SELECT count(*) FROM top_time_queries(10) v
129133
WHERE v.execution_time > 0.");
130-
is($res,10);
134+
is($res,5);
131135

132136
# ##############################################################################
133137
#
@@ -281,7 +285,8 @@
281285
SELECT abalance FROM pgbench_accounts WHERE aid = :aid;
282286
UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE tid = :tid;
283287
UPDATE pgbench_branches SET bbalance = bbalance + :delta WHERE bid = :bid;
284-
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime) VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
288+
INSERT INTO pgbench_history (tid, bid, aid, delta, mtime)
289+
VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);
285290
END;
286291
\endif
287292
});
@@ -295,7 +300,7 @@
295300
$node->restart();
296301

297302
$node->command_ok(['pgbench','-T',
298-
"5",'-c',"$CLIENTS",'-j',"$THREADS" ,'-f',"$bank"],
303+
"50",'-c',"$CLIENTS",'-j',"$THREADS" ,'-f',"$bank"],
299304
'Conflicts with an AQO dropping command.');
300305

301306
$node->stop();

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp