Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLBKy-0002ol-Tm for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2015 14:31:05 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZLBKy-00040c-Ev for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2015 14:31:04 +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) (envelope-from ) id 1ZLBKv-0003zn-QN for pgsql-hackers@postgresql.org; Fri, 31 Jul 2015 14:31:03 +0000 Received: from nm16.bullet.mail.gq1.yahoo.com ([98.137.176.58]) by magus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZLBKr-0004tM-Ps for pgsql-hackers@postgresql.org; Fri, 31 Jul 2015 14:31:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1438353054; bh=Gks1v5dlNIzJtqeiDQN28t9+kT+GA+qD4+qhMndxQ8k=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=ZQLkNjhinnU3QZMHkrCer0n3pP3koCanPwqbz+w3VacjWj4fQ3RnfRP0pNvemfd9PB/FvVuyrVcw0j+K6nlJkKqRiEFsEdmMRZ3XPdHafNA0SFwLZ4i9r/wFhzSx3XZPZFs6DhINgfcxInzt0sMwFvsKWOhGdm21AUKbRRW8ptrUph75EExj2j++PukEx7EgwkM4rsuuU94wD4kVRe2svHh1ZUenWNodqOkJoXnR1DUIQXBpxk8wkCZAhXUZeZIHjgyhf6nzeabadpmwUKJYq+IuH7pecyvFgfdsJ1qCixwGpMkNRLIrgHpeiMJ9iYGtz6Vd9VibygPpSs8UwLJkxA== Received: from [98.137.12.63] by nm16.bullet.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:30:54 -0000 Received: from [98.137.12.222] by tm8.bullet.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:30:54 -0000 Received: from [127.0.0.1] by omp1030.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:30:54 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 755228.53407.bm@omp1030.mail.gq1.yahoo.com X-YMail-OSG: o744FwsVM1n8wNiBZHk7oRAu8qeuNiMkn_DrQsVGoueyy1_xzbNfAltuxxiNDlH cOrHXLWd8P3TGLdx1.lQXkrRmksjV4N1PFtBiknnwSdhOrs4lfVR124qADdnLrXSkTTHmCAaDsgR 6eZV8B_UReFi64r4BePp0WNtcp8M3fUH7fSaMhlRrpgFjuLFrtuGuFibVJlMUHK7x3MnKptR.C7d GnkLzrCRmtQRl4K8vhYCHKRQC8vEbGUlwF9sWeVMebRNx5bAaWRuh2dYJM8IkgkY5Q3eG3uP6Ej2 tqKBmqYmMQjvZDhgK427nB07EEBHbdKNKOKITDwQUcGtp_HsjXVzcjWrYWMV0zCr4yvvU25jMPLe NDFJo1l3OxO_E0LhVYk3KvmyAuRM2.2Vp2lkQvUx18e.QLKhQ7N_sugRsIEJp3rd_5_AUIygTkMw UK91zR2O6GSDP23V6A4WRY3npqFgIw3dA5bkR4tX09egBC_WDikvW5b9r Received: by 216.39.60.196; Fri, 31 Jul 2015 14:30:54 +0000 Date: Fri, 31 Jul 2015 14:30:52 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Alvaro Herrera Cc: PostgreSQL-development Message-ID: <784585654.3180934.1438353052254.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: <20150730200140.GV2441@postgresql.org> References: <20150730200140.GV2441@postgresql.org> Subject: Re: brin index vacuum versus transaction snapshots MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Content-Length: 2085 X-Pg-Spam-Score: -2.7 (--) 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 Alvaro Herrera wrote: > Kevin Grittner wrote: >> If you run `make installcheck` against a cluster with >> default_transaction_isolation = 'repeatable read' you get one >> failure: > > I am tempted to say that we should just disallow to run vacuum on > a table containing a brin index in a transaction-snapshot > transaction. You do realize that the VACUUM command was not run inside an explicit transaction, right? The only change was that in the postgresql.conf file I set default_transaction_isolation = 'repeatable read'. That was my first step before confirming that nothing was broken for 'serializable'; but if it doesn't pass in 'repeatable read' it's not going to pass in serializable. Anyway, for those using serializable transactions to handle race conditions so that they don't need to use explicit LOCK TABLE statements or SELECT FOR UPDATE clauses, setting that as the default in postgresql.conf is standard procedure. Are you suggesting that those users should need to run VACUUM commands bracketed with adjustments to that GUC, like this?: set default_transaction_isolation = 'read committed'; vacuum [...]; reset default_transaction_isolation; What about autovacuum? > It is possible to silence the problem by checking for vacuum > flags, but (without testing) I think there will be a problem > because the snapshot is acquired too early and it is possible for > concurrent transactions to insert tuples in the table that the > summarizing scan will not see, which will cause the index to > become effectively corrupt. If that's true, it sounds like vacuum of BRIN indexes might be broken in a pretty fundamental way. Shouldn't it be using a snapshot that lets it see everything past the global xmin threshold, and let the *users* of the index ignore those tuples that are not visible to *them*? From what you're saying here it sounds like the BRIN index is failing to include in its bounds any tuples not visible to some arbitrary snapshot? -- Kevin Grittner EDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers