Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enhe4-0001HV-Uo for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Feb 2018 09:22:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1enhe4-0005L4-2i for pgsql-bugs@arkaria.postgresql.org; Mon, 19 Feb 2018 09:22:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1enhe3-0005Ka-TR for pgsql-bugs@lists.postgresql.org; Mon, 19 Feb 2018 09:21:59 +0000 Received: from new1-smtp.messagingengine.com ([66.111.4.221]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1enhe2-0001eu-0W for pgsql-bugs@lists.postgresql.org; Mon, 19 Feb 2018 09:21:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.nyi.internal (Postfix) with ESMTP id D2EDF148F; Mon, 19 Feb 2018 04:21:56 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Mon, 19 Feb 2018 04:21:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=QHMKhhRcn8VPvY9jaaCq2/STbmYGVu4hvu+MSPPbUIg=; b=j2kFmYG6 VeefYy9Ba9w7bvrIKzPUo7W3E8xhuO3ndDUH7AAX+AGmSxbSzcVmmpa0WNEsdmdq fHiMpk06XTu1HLC3TsdcDH7r4HfW7CZL6ccqNLH1kXGroWjv60O6FjIkNc4HaPpY s4dU44z0Ea9TMtk+LmGzRYhBMKa1BLgZYBKz31raGlzweGTtBp8ZGmoSPqxE998O qGd2UPmgBsh/SaHT9PAytEcOJMPYZZpBhgeGzeALZXr7Bxj7u0acug1Jtme898Nc 55KfV3pLCNIvLZLXwe0fLJb7W+Oi05l2VNzk6/8tizgzqAdAq1xCUOxudSE3uFlX JEOaqG8lV8mbnw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=QHMKhhRcn8VPvY9jaaCq2/STbmYGV u4hvu+MSPPbUIg=; b=NhHYBnfedVlLyzdH/sTsI+maJwjun6TyOKeTtJzXbhscL zgMPv+rlg5V7g1HOf1CwWEj3Qc8Iw13OTn2wxV9m7wVh5+w2pmX2ICH+71XtOnQN fA7oWiHYef/7cLI6grPUqvA7EK/c5Jm92SKUt9c2Y9kUjBU3v/o1snaW1hX6k7Cg P4jJsvf7q5Aksba+95VL1JLWQaIZpGUeWBlzyQUUgSP/9YzbmQgnUhDjQyJ7UNtq IFaszqAy/kE8SttuNdDV7zWGw0eHknLyJ9rJYGY0QLTZohM6VVNoBm7SSpCupHCT kjXDOp68z0VbTyO/OFRgkn0RAfqmx6ENrSs/JN6lw== X-ME-Sender: Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp [61.215.137.162]) by mail.messagingengine.com (Postfix) with ESMTPA id 9431624108; Mon, 19 Feb 2018 04:21:55 -0500 (EST) Date: Mon, 19 Feb 2018 18:21:52 +0900 From: Michael Paquier To: lars.vonk@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #15074: psql client never returns when creating index (long running operation) Message-ID: <20180219092152.GB42340@paquier.xyz> References: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="98e8jtXdkpgskNou" Content-Disposition: inline In-Reply-To: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --98e8jtXdkpgskNou Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Feb 19, 2018 at 08:26:48AM +0000, PG Bug reporting form wrote: > When creating an index on a table containing approx. 100M records the psql > client never returns when the index is eventually created on the server. = =20 > This happens both in a psql client (9.6.6) on mac osx and using the libpq > client via the ruby pg gem when using active records migrations.=20 Are you sure that the process got stuck? Perhaps it was spending a lot of time processing and you did not wait for it to finish. > When running the command directly op the postgres database server using t= he > psql client it works as expected. >=20 > The logs from the server: > 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141= ]: > LOG: duration: 999618.165 ms > 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141= ]: > LOG: could not receive data from client: Connection reset by peer >=20 > The psql client just hangs, when trying to cancel the query client side > (ctrl-c) the server logs says: > 2018-02-16 16:13:53 CET:82.161.205.254(59961):[unknown]@[unknown]:[25738]: > LOG: PID 23141 in cancel request did not match any process How is defined your schema? It could be possible that a CHECK_FOR_INTERRUPTS() added in the code paths where the type of the index you are creating is involved could help in making the system more responsive to cancel requests. -- Michael --98e8jtXdkpgskNou Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlqKlzAACgkQnvQgOdby QH3uNBAAidxdYKDdOyhGX3xWUfGwhUA/3EigDWIAZTJqpRrzz47lp8KtLt8nvE1S pIk3eJ1iPvg9dx7sOctGO/dTjlNLMuQaqf+h6nu5eQk8hP4dj2rvdDv2Ey4bTzxx dn6mQg06KXnJdukKw28H9N4Pk76FpFcBdduDa3vTIOVq4IacRS8HI26vFqjsJj8T 2Xf6pEeR8UoQmHQACXn4oKCI/OrmrspSq/VH/wdpv+PPea5Pp0SooacpEe61Vxsu MCz3c0GKOtXb0fnTvFU+znFePdxUywALQFTKH9B0HGQGe/4lnFl5HMYeIG7c73tn hlUkNvpNWNu2mjqUt9b3AH5EzCl2FvqQRmDXKR8Bv+cTXd/uQgyceOzYSh4y6P1y yILSEuLbFJEw+F/DNRbZVAWHypvnup4uPpZxLJUbPu00qcyKK24L4hCNDzJFZQuc Y1WcWNrhI3+Pp4nCbHV915Z0S5rD/ML0XNIn6ZFrDy+yYkiKBLyqKFBbp/mhFeW5 hnQcQHNsd4otfIeFuyQldMWc588olh3XrLSss9GaiGYoTIMRRoeoyEeFs7nID3Uz aWlDe7VbgJGA5FA+QMPdj1DZ1VMuWS0NlF1oh1wO0pwJUcYc9TtsgmN2muCNmbnP 1mgFGYyKsabsd6+bmVC+jqRs9mpwK8fZsns6ueMQ8rcc7Viy5Y8= =4qtT -----END PGP SIGNATURE----- --98e8jtXdkpgskNou--