Avoid instability in output of new REINDEX SCHEMA test.
The planner seems to like to do this join query as a hash join, making the output ordering machine-dependent; worse, it's a hash on OIDs, so that it's a bit astonishing that the result doesn't change from run to run even on one machine. Add an ORDER BY to get consistent results. Per buildfarm. I also suppressed output from the final DROP SCHEMA CASCADE, to avoid occasional failures similar to those fixed in commit 81d815dc3ed74a7d. That hasn't been observed in the buildfarm yet, but it seems likely to happen in future if we leave it as-is.
This commit is contained in:
parent
7e354ab9fe
commit
1c5c70df45
@ -2867,21 +2867,22 @@ SELECT b.relname,
|
||||
b.relkind,
|
||||
CASE WHEN a.relfilenode = b.relfilenode THEN 'relfilenode is unchanged'
|
||||
ELSE 'relfilenode has changed' END
|
||||
FROM reindex_before b JOIN pg_class a ON b.oid = a.oid;
|
||||
FROM reindex_before b JOIN pg_class a ON b.oid = a.oid
|
||||
ORDER BY 1;
|
||||
relname | relkind | case
|
||||
----------------------+---------+--------------------------
|
||||
table1_col1_seq | S | relfilenode is unchanged
|
||||
table1 | r | relfilenode is unchanged
|
||||
table1_pkey | i | relfilenode has changed
|
||||
table2_col1_seq | S | relfilenode is unchanged
|
||||
table2 | r | relfilenode is unchanged
|
||||
table2_pkey | i | relfilenode has changed
|
||||
table2_col2_idx | i | relfilenode has changed
|
||||
matview | m | relfilenode is unchanged
|
||||
matview_col1_idx | i | relfilenode has changed
|
||||
view | v | relfilenode is unchanged
|
||||
pg_toast_TABLE | t | relfilenode is unchanged
|
||||
pg_toast_TABLE_index | i | relfilenode has changed
|
||||
table1 | r | relfilenode is unchanged
|
||||
table1_col1_seq | S | relfilenode is unchanged
|
||||
table1_pkey | i | relfilenode has changed
|
||||
table2 | r | relfilenode is unchanged
|
||||
table2_col1_seq | S | relfilenode is unchanged
|
||||
table2_col2_idx | i | relfilenode has changed
|
||||
table2_pkey | i | relfilenode has changed
|
||||
view | v | relfilenode is unchanged
|
||||
(12 rows)
|
||||
|
||||
REINDEX SCHEMA schema_to_reindex;
|
||||
@ -2897,11 +2898,6 @@ ERROR: must be owner of schema schema_to_reindex
|
||||
-- Clean up
|
||||
RESET ROLE;
|
||||
DROP ROLE regression_reindexuser;
|
||||
SET client_min_messages TO 'warning';
|
||||
DROP SCHEMA schema_to_reindex CASCADE;
|
||||
NOTICE: drop cascades to 6 other objects
|
||||
DETAIL: drop cascades to table table1
|
||||
drop cascades to table table2
|
||||
drop cascades to materialized view matview
|
||||
drop cascades to view view
|
||||
drop cascades to table reindex_before
|
||||
drop cascades to table reindex_after
|
||||
RESET client_min_messages;
|
||||
|
@ -1000,7 +1000,8 @@ SELECT b.relname,
|
||||
b.relkind,
|
||||
CASE WHEN a.relfilenode = b.relfilenode THEN 'relfilenode is unchanged'
|
||||
ELSE 'relfilenode has changed' END
|
||||
FROM reindex_before b JOIN pg_class a ON b.oid = a.oid;
|
||||
FROM reindex_before b JOIN pg_class a ON b.oid = a.oid
|
||||
ORDER BY 1;
|
||||
REINDEX SCHEMA schema_to_reindex;
|
||||
BEGIN;
|
||||
REINDEX SCHEMA schema_to_reindex; -- failure, cannot run in a transaction
|
||||
@ -1014,4 +1015,6 @@ REINDEX SCHEMA schema_to_reindex;
|
||||
-- Clean up
|
||||
RESET ROLE;
|
||||
DROP ROLE regression_reindexuser;
|
||||
SET client_min_messages TO 'warning';
|
||||
DROP SCHEMA schema_to_reindex CASCADE;
|
||||
RESET client_min_messages;
|
||||
|
Loading…
x
Reference in New Issue
Block a user