Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZLBcL-0003gn-TB for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2015 14:49:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZLBcL-0005vu-Dq for pgsql-hackers@arkaria.postgresql.org; Fri, 31 Jul 2015 14:49:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZLBcK-0005vo-MU for pgsql-hackers@postgresql.org; Fri, 31 Jul 2015 14:49:00 +0000 Received: from nm28-vm1.bullet.mail.gq1.yahoo.com ([98.136.216.160]) by makus.postgresql.org with esmtps (TLS1.0:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1ZLBcH-0003St-Mb for pgsql-hackers@postgresql.org; Fri, 31 Jul 2015 14:48:59 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ymail.com; s=s2048; t=1438354135; bh=X3MaBAK9kooOvKYHZ/FQmiKdbIaTFQAFmgbswKdQvj0=; h=Date:From:Reply-To:To:Cc:In-Reply-To:References:Subject:From:Subject; b=AEXTMrtIe0x32jmsnueYN9UabswC2sN5RBhvlRUspd4xC9aU5GurNXRHiBkIrmCxQX7As+LFBIbCZCSdDns6vzO2A9V5bVFV6/ZByKfJyF0SeGTk0+ObFVWCgR7C5qTUJ/PB38i2cUfydkYvllOHoio8DsvGVJZtlCb2xt7LDK3+pt7km3fYZRIdBJNyZBwgJYj04Va5obEVPTUknC6WtrAA6z7T9yyQjrnyILfALaHiJj3nhwpDatAM4j9yMZqq3jTRlC1FeFXoBba2hxwTkvxiImgNdRnEySQgJ7GbhLGtKLRZTBoI5oU9dx3SYC3S5TiwXsnSgGa+wEFapSHitg== Received: from [98.137.12.60] by nm28.bullet.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:48:55 -0000 Received: from [98.137.12.231] by tm5.bullet.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:48:55 -0000 Received: from [127.0.0.1] by omp1039.mail.gq1.yahoo.com with NNFMP; 31 Jul 2015 14:48:55 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 762545.19355.bm@omp1039.mail.gq1.yahoo.com X-YMail-OSG: figW.AEVM1niJP7BDPSOYBwUgJ5g0qZb4PQ3v_Xb3QLNeLlOFAQM1yNq_03kXdB mIrtM15FioY2AMQvQqviHgPko58n5PUoc4jxWYpsWXMJK8QtiMiKQ0S8LyqqViSYCATbQVOLrlD3 VWeZc8gnuPQOgopM_S263FseHqMkT8s.kbJwXqDLTswxxxoJuCsloQtEmRbetABM_0tXM76PiCAu pS_HgBABo00Q4XWqvNel2ty_DpkOtZDhID1T2cel29eMdLllYcEoYNvPk.tU_YOz2v7.1m1s39GR 0yuWDj95sH5yDASyCbP.J2GRoxTJJutdYNm1F.kXoC0rXYBkzlMQTbkFXozpGoIHW73cjxx19Cyw 2lv2U2R5TFsPtrOB8MU6BHvkrkN2.Ob7TUODBK7zQ9pOD5dXxSFK.G0tt2ghbndF1XtecnTMGwXN sG.pniHh8.ipHs_KZjTRJloHiSOUBiv8fYJuZJClb2saqdL5pkEJI7zr57wo1aODFx6UF8djEOLW upjB.SOekoZo1eS2.SX4- Received: by 98.137.12.52; Fri, 31 Jul 2015 14:48:55 +0000 Date: Fri, 31 Jul 2015 14:48:54 +0000 (UTC) From: Kevin Grittner Reply-To: Kevin Grittner To: Simon Riggs , Tom Lane Cc: Alvaro Herrera , PostgreSQL-development Message-ID: <1886585581.3039942.1438354135003.JavaMail.yahoo@mail.yahoo.com> In-Reply-To: References: 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: 2354 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 Simon Riggs wrote: > On 30 July 2015 at 22:24, Tom Lane wrote: >> Alvaro Herrera writes: >>> 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. >> >> Huh? We don't allow vacuum inside a (user started) transaction >> now. What new restriction are you proposing? > > Forgive me, but I believe there is a confusion here. Nobody is > changing VACUUM. > > The code comment mentioned as "full of it" by Kevin appears to be > accurate and appropriate. > > The code is called by VACUUM and brin_summarize_new_values(). It > can't be VACUUM, Reread the thread. The error is being hit on a VACUUM command (which is not, of course in any explicit transaction). > as you say and as the comment already says, so it must be the > function brin_summarize_new_values(). It is, in fact, not brin_summarize_new_values() -- as shown by the stack trace when the error is thrown. This is why it is such a bad idea to have any function assume that it knows everywhere it is being called from, and under what conditions each caller will call it. (That's distinct from a function having a documented API about invariants which must be true when calling the function.) A simple thinko like forgetting that even a VACUUM command starts a transaction if it is not already in an explicit transaction can cause confusing problems when the function makes a bad guess at who "must have" called it. Let the function name itself it if is going to name something (in a user-facing error message) that is only visible to those with access to the source code. Better yet, write an error message that will mean something to those users who don't have the source code handy. > The test assumes that the default_transaction_isolation is read > committed and so the test fails at other levels. If anything, it > is the test that is at fault. Yes, the test being wrong is a bigger problem than an arcane and misleading error message when it causes a failure. -- 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