Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLWyP-0007NP-H7 for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Oct 2019 18:27:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iLWxO-00085c-DP for pgsql-hackers@arkaria.postgresql.org; Fri, 18 Oct 2019 18:26:34 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iLWxN-000851-S3 for pgsql-hackers@lists.postgresql.org; Fri, 18 Oct 2019 18:26:34 +0000 Received: from mail-il1-x142.google.com ([2607:f8b0:4864:20::142]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1iLWxK-0006Re-5L for pgsql-hackers@lists.postgresql.org; Fri, 18 Oct 2019 18:26:32 +0000 Received: by mail-il1-x142.google.com with SMTP id c12so6427350ilm.1 for ; Fri, 18 Oct 2019 11:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :in-reply-to:user-agent; bh=pynzm/+tP6iHqiBcTEUOk3T6QCC4nUEou5QYcYwUUw0=; b=cEbHgxTcNYOIx2CCm7TxE+mLwA8DT8j0Voz0BSnG9aL+iw3Y4hxF1E4QpQKJ8tOi9G U/B+DesBtmbi7h6p9moNypCn90PhF8HszBJe8vS8kLJtqvQ5x6gDemdzA8gLdiULzhVX KjaQhW+TetYMcbtNBffIr8IZA12B2v2v2frRgbtgLhqzJYWBNWJi3ikuc1eijPEWQ06r TjXPYCbdYGw1sYY11KO0s+FMolNtEOrzcf/tiqfCayUH0x80HTgXdTZgLb0A8umjvZeO oY6A+0d9PMEr4Ro7v67rePFrTPt6cv2WKTI2WWHX2yglh6wtq6VJEkilFHISDVgDAJTC i9RQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:in-reply-to:user-agent; bh=pynzm/+tP6iHqiBcTEUOk3T6QCC4nUEou5QYcYwUUw0=; b=R+6capTUCIcnezveYPXqaajp5+KbVE4jHAA/98jiusC6+BU0rBs9dtVcCPqmSM1E4/ oDUpt7rZRUDDDWI5B57ZG8rIwcURhY9eZmoA/OFMtELKuqEMan3weYKxJErgL5v6iqBr I67KLbx/YNoUGduj6p5T9Os64akTSEgKesMibW3EH7pY+t6Xc6WeFfJ9FmnYQte8IEcb OI+reIQSO0+Q+58wYPi5u0afMYloGUufc6bNSZ6d/b+Yi7mD2G+ZoRukoQv2qP8CO9eC WpCzbsQEx7oQgaVPEwfwzfRYMTQfvKXYFLqPBXqgEcm8aVWKBknhMWI9ykV/LxQxQ6ma VGBA== X-Gm-Message-State: APjAAAXSERyYsFRpZYgz8NgfZKWoQBQHaGd9cNyy9fa194bGqtH5QVN5 FAeh4D1eWSjFfT6Nml8ZdpmBLK9DX68= X-Google-Smtp-Source: APXvYqzoHVUvqYMY6uhYt5wkTA8e27G1rjfMXZfQprDxQHjThAMJI9Z/O4yKMU4U9i6oz2RxQRxb8A== X-Received: by 2002:a92:3b82:: with SMTP id n2mr12455026ilh.46.1571423189253; Fri, 18 Oct 2019 11:26:29 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id q77sm2645164ill.41.2019.10.18.11.26.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 18 Oct 2019 11:26:28 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 72C498015C0; Fri, 18 Oct 2019 13:26:27 -0500 (CDT) Date: Fri, 18 Oct 2019 13:26:27 -0500 From: Justin Pryzby To: pgsql-hackers@lists.postgresql.org Cc: Michael Paquier , Peter Eisentraut , Andreas Karlsson Subject: Re: v12.0: reindex CONCURRENTLY: lock ShareUpdateExclusiveLock on object 14185/39327/0 is already held Message-ID: <20191018182627.GI3599@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191015164047.GA22729@telsasoft.com> <20191013025145.GC4475@telsasoft.com> User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Checking if anybody is working on either of these https://www.postgresql.org/message-id/20191013025145.GC4475%40telsasoft.com https://www.postgresql.org/message-id/20191015164047.GA22729%40telsasoft.com On Sat, Oct 12, 2019 at 09:51:45PM -0500, Justin Pryzby wrote: > I ran into this while trying to trigger the previously-reported segfault. > > CREATE TABLE t(i) AS SELECT * FROM generate_series(1,9); > CREATE INDEX ON t(i); > > [pryzbyj@database ~]$ for i in `seq 1 9`; do PGOPTIONS='-cstatement_timeout=9' psql postgres --host /tmp --port 5678 -c "REINDEX INDEX CONCURRENTLY t_i_idx" ; done > ERROR: canceling statement due to statement timeout > ERROR: lock ShareUpdateExclusiveLock on object 14185/47287/0 is already held > [...] > > Variations on this seem to leave the locks table (?) or something else in a > Real Bad state, such that I cannot truncate the table or drop it; or at least > commands are unreasonably delayed for minutes, on this otherwise-empty test > cluster. On Tue, Oct 15, 2019 at 11:40:47AM -0500, Justin Pryzby wrote: > On a badly-overloaded VM, we hit the previously-reported segfault in progress > reporting. This left around some *ccold indices. I tried to drop them but: > > sentinel=# DROP INDEX child.alarms_null_alarm_id_idx1_ccold; -- child.alarms_null_alarm_time_idx_ccold; -- alarms_null_alarm_id_idx_ccold; > ERROR: could not find tuple for parent of relation 41351896 > > Those are children of relkind=I index on relkind=p table. > > postgres=# CREATE TABLE t(i int)PARTITION BY RANGE(i); > postgres=# CREATE TABLE t1 PARTITION OF t FOR VALUES FROM (1)TO(100); > postgres=# INSERT INTO t1 SELECT 1 FROM generate_series(1,99999); > postgres=# CREATE INDEX ON t(i); > > postgres=# begin; SELECT * FROM t; -- DO THIS IN ANOTHER SESSION > > postgres=# REINDEX INDEX CONCURRENTLY t1_i_idx; -- cancel this one > ^CCancel request sent > ERROR: canceling statement due to user request > > postgres=# \d t1 > ... > "t1_i_idx" btree (i) > "t1_i_idx_ccold" btree (i) INVALID > > postgres=# SELECT inhrelid::regclass FROM pg_inherits WHERE inhparent='t_i_idx'::regclass; > inhrelid > t1_i_idx > (1 row) > > Not only can't I DROP the _ccold indexes, but also dropping the table doesn't > cause them to be dropped, and then I can't even slash dee them anymore: > > jtp=# DROP INDEX t1_i_idx_ccold; > ERROR: could not find tuple for parent of relation 290818869 > > jtp=# DROP TABLE t; -- does not fail, but .. > > jtp=# \d t1_i_idx_ccold > ERROR: cache lookup failed for relation 290818865 > > jtp=# SELECT indrelid::regclass, * FROM pg_index WHERE indexrelid='t1_i_idx_ccold'::regclass; > indrelid | 290818865 > indexrelid | 290818869 > indrelid | 290818865 > [...]