Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8cf98da

Browse files
committed
PGPRO-2065: do not ignore indisready and indisvalid indexes
1 parent 47283e1 commit 8cf98da

File tree

1 file changed

+10
-13
lines changed

1 file changed

+10
-13
lines changed

src/backup.c

+10-13
Original file line numberDiff line numberDiff line change
@@ -1056,11 +1056,7 @@ do_amcheck(void)
10561056

10571057
n_databases = PQntuples(res_db);
10581058

1059-
/* TODO Warn user that one connection is used for snaphot */
1060-
//if (num_threads > 1)
1061-
// num_threads--;
1062-
1063-
elog(INFO, "Start checking instance with amcheck");
1059+
elog(INFO, "Start checking PostgreSQL instance with amcheck");
10641060

10651061
/* For each database check indexes. In parallel. */
10661062
for(i = 0; i < n_databases; i++)
@@ -3522,12 +3518,13 @@ get_index_list(PGresult *res_db, int db_number,
35223518
{
35233519

35243520
/* select only valid btree and persistent indexes */
3525-
res = pgut_execute(db_conn, "SELECT cls.oid, cls.relname"
3526-
" FROM pg_index idx "
3527-
" JOIN pg_class cls ON cls.oid=idx.indexrelid "
3528-
" JOIN pg_am am ON am.oid=cls.relam "
3529-
" WHERE am.amname='btree' AND cls.relpersistence != 't'"
3530-
" AND idx.indisready AND idx.indisvalid; ", 0, NULL);
3521+
res = pgut_execute(db_conn, "SELECT cls.oid, cls.relname "
3522+
"FROM pg_index idx "
3523+
"JOIN pg_class cls ON cls.oid=idx.indexrelid "
3524+
"JOIN pg_am am ON am.oid=cls.relam "
3525+
"WHERE am.amname='btree' AND cls.relpersistence != 't'",
3526+
//"AND idx.indisready AND idx.indisvalid",
3527+
0, NULL);
35313528
}
35323529
else
35333530
{
@@ -3538,8 +3535,8 @@ get_index_list(PGresult *res_db, int db_number,
35383535
"JOIN pg_am am ON am.oid=cls.relam "
35393536
"JOIN pg_tablespace tbl ON tbl.oid=cls.reltablespace "
35403537
"WHERE am.amname='btree' AND cls.relpersistence != 't' "
3541-
"AND idx.indisready AND idx.indisvalid "
3542-
"AND tbl.spcname !='pg_global'", 0, NULL);
3538+
//"AND idx.indisready AND idx.indisvalid "
3539+
"AND tbl.spcname !='pg_global'",0, NULL);
35433540
}
35443541

35453542
/* add info needed to check indexes into index_list */

0 commit comments

Comments
 (0)