Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wswom-0000cE-Or for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Jun 2014 16:16:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1Wswol-0005FH-5o for pgsql-bugs@arkaria.postgresql.org; Fri, 06 Jun 2014 16:16:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1Wsgeh-0006PK-7L for pgsql-bugs@postgresql.org; Thu, 05 Jun 2014 23:01:07 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1Wsged-0003f9-65 for pgsql-bugs@postgresql.org; Thu, 05 Jun 2014 23:01:05 +0000 MIME-Version: 1.0 Subject: BUG #10542: infinite loop in index.c when trying to reindex system tables (probably corrupted db state) To: pgsql-bugs@postgresql.org From: hannes.janetzek@gmail.com Date: Thu, 05 Jun 2014 23:00:56 +0000 Message-ID: <20140605230056.3066.26092@wrigleys.postgresql.org> X-Pg-Spam-Score: -0.3 (/) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 10542 Logged by: Hannes Janetzek Email address: hannes.janetzek@gmail.com PostgreSQL version: 9.3.4 Operating system: Linux, Ubuntu 12.04 Description: While trying to get our database working again after a forced shutdown the reindexing of the system tables in single user mode went into an infinite loop. I can just roughly guess that between the lines: https://github.com/postgres/postgres/blob/REL9_3_STABLE/src/backend/catalog/index.c#L2260- L2385 the function is assuming that another process tries to delete a tuple that is about to be indexed (even though in single user mode this should probably not be possible) I found these lines by attaching gdb and stepping through. The command to reindex was: sudo -u postgres /usr/lib/postgresql/9.3/bin/postgres --single -D /etc/postgresql/9.3/main -d 5 osm backend> REINDEX SYSTEM osm; 2014-06-05 23:36:27 CEST STATEMENT: REINDEX SYSTEM osm; 2014-06-05 23:36:27 CEST DEBUG: ProcessUtility 2014-06-05 23:36:27 CEST DEBUG: CommitTransaction 2014-06-05 23:36:27 CEST DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 2014-06-05 23:36:27 CEST DEBUG: StartTransaction 2014-06-05 23:36:27 CEST DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 2014-06-05 23:36:27 CEST DEBUG: building index "pg_class_oid_index" on table "pg_class" 2014-06-05 23:36:27 CEST DEBUG: building index "pg_class_relname_nsp_index" on table "pg_class" 2014-06-05 23:36:27 CEST NOTICE: table "pg_catalog.pg_class" was reindexed 2014-06-05 23:36:27 CEST DEBUG: CommitTransaction 2014-06-05 23:36:27 CEST DEBUG: name: unnamed; blockState: STARTED; state: INPROGR, xid/subid/cid: 196462163/1/4, nestlvl: 1, children: 2014-06-05 23:36:27 CEST DEBUG: StartTransaction 2014-06-05 23:36:27 CEST DEBUG: name: unnamed; blockState: DEFAULT; state: INPROGR, xid/subid/cid: 0/1/0, nestlvl: 1, children: 2014-06-05 23:36:27 CEST DEBUG: building index "pg_statistic_relid_att_inh_index" on table "pg_statistic" -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs