Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WfaCL-00082q-9x for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Apr 2014 19:29:41 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1WfaCK-00012v-HP for pgsql-hackers@arkaria.postgresql.org; Wed, 30 Apr 2014 19:29:40 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WfaCI-00012m-LK for pgsql-hackers@postgresql.org; Wed, 30 Apr 2014 19:29:38 +0000 Received: from tamriel.snowman.net ([2001:4830:167b::11]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1WfaCF-000362-EN for pgsql-hackers@postgresql.org; Wed, 30 Apr 2014 19:29:37 +0000 Received: by tamriel.snowman.net (Postfix, from userid 1000) id D43C25F7E8; Wed, 30 Apr 2014 15:29:34 -0400 (EDT) Date: Wed, 30 Apr 2014 15:29:34 -0400 From: Stephen Frost To: Greg Stark Cc: Peter Geoghegan , Jeff Janes , Robert Haas , Tan Tran , PostgreSQL-development Subject: Re: GSoC on WAL-logging hash indexes Message-ID: <20140430192934.GM2556@tamriel.snowman.net> References: <54977A8C-4AF5-4BCC-B021-78E9CA978077@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="vA6Zb4g90/qw89oz" Content-Disposition: inline In-Reply-To: X-Editor: Vim http://www.vim.org/ X-Info: http://www.snowman.net X-Operating-System: Linux/3.11.0-19-generic (x86_64) X-Uptime: 15:24:58 up 22 days, 5:44, 4 users, load average: 0.13, 0.09, 0.11 User-Agent: Mutt/1.5.21 (2010-09-15) X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org --vA6Zb4g90/qw89oz Content-Type: text/plain; charset=us-ascii Content-Disposition: inline * Greg Stark (stark@mit.edu) wrote: > But imnsho doing nothing is a bad idea. We should have long ago either > added WAL logging or removed the index type. We shouldn't have left a > foot-gun that large lying around for so long. I certainly encourage you to work on it. :) > Incidentally something else I've considered would be having a WAL > record type saying "relation corrupted" and emitting one the first > time a hash index is touched after a checkpoint. That could provide a > general mechanism that might be useful for unlogged operations (and > might be combinable with the infrastructure for unlogged tables). But > it seems like a better tool for other objects than hash indexes. Ugh, please do not make unlogged tables suffer for this. I feel it is *quite* clear when you say "UNLOGGED" or "TEMP" in the CREATE statement that you know what you're gonna get. Perhaps we should require 'UNLOGGED INDEX' to be passed in when someone creates a 'hash' index instead. > Another quick fix would be having a GUC allow_unrecoverable_relations > which defaulted to false. Creating a hash index (and presumably > unlogged tables) would error out with a hint to set that to true so at > least users who create them would have to know what they were in for. -1 > Right now we're seeing a lot of users who create hash indexes and then > complain about corrupted standbys. Uh, we are? If you're saying that $employer is, great, but please clarify that as the rest of us aren't 'in the loop' as far as that goes and we see the various list/IRC traffic instead, and I can't remember ever seeing such a complaint in either place (but I'll admit, my memory isn't the best). > I could do the legwork on either the GUC or moving hash indexes to an > extension if there's a consensus. But I suspect either will be quite > controversial... -1 on the GUC. I'd be alright with finding a way to make it clear, upon creation of the hash index, that it's not WAL'd (maybe even just throw a WARNING, it'd be better than nothing..). Trying to rip out the current hash index wouldn't be great, imv. If you'd like to build an extension which provides hash indexes- I say go for it? Nothing stopping you as far as that's concerned. Thanks, Stephen --vA6Zb4g90/qw89oz Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) iQIcBAEBAgAGBQJTYU8eAAoJEO1sijiDR2RVC1QP/0K+OsOAhJXxiBdsRtqKVfI4 w2ZRa8bOmtrTo77vR2CYgsnr7db1RHD9yiONzl/1SCkcm12hgna9UE7ZXHVB1ZEF CfowKhir6yCDYn0uTploH3wTXA/UA+4ButLkAhZ5ZJorDO2cXi9JL+h6DFTb8POY c12ytqhFXsCPvBrpKyOQx71rAgD933dONGi7uuOcN1duXDsSTdTdJMIMYBIWNAf+ DXARaM2fU2dERDw6KhictLVriWtcMIaLyOTjcyWqrZWydL9vnpeslp/FT3KIGGBR qu6NDGwuqIkXkiBr9sDM9u8mjQut6VkiWZobfjlB9PIDYYFI9QYfPsjbNeOanX4f DbSwDRxbDqJ5B48iwn1kIqYbc9uU7LOACw9pLPWP451I7nP9hI+1broNzb2gQexo XF1xHbUGudT2fFHgxnrAJu6X70KTtLesbq8p0sj/QvzhKf8iaJc6cM4jr2/tPrCS saJScup9suCwwSSKutDpkuGOVMLvoEZvtPXTC3wh/Z1Wrl+p4KrEglkJuUPOCC4Q 2aKe4XopYWMx9B5p7dE7IrSxcEkWiUzVVypg3GKM7AO6y9mgO9ykCgndKnzA7UiF LJtHqg9ZnETxhD3ovz3G80DOw9BT2BhD9df6jT+3k2BFLQeaz3mCb86cDLZeUtcJ osWjCtIopDsm92f+aGKR =RVsM -----END PGP SIGNATURE----- --vA6Zb4g90/qw89oz--