Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aM7Rf-00019b-9Z for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jan 2016 05:06:07 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aM7Re-0005a3-La for pgsql-bugs@arkaria.postgresql.org; Thu, 21 Jan 2016 05:06:06 +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 1aM7Re-0005Zx-Cc for pgsql-bugs@postgresql.org; Thu, 21 Jan 2016 05:06:06 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aM7Rb-0006ux-TL for pgsql-bugs@postgresql.org; Thu, 21 Jan 2016 05:06:05 +0000 MIME-Version: 1.0 Subject: BUG #13878: Hot Standby Query Conflict documentation leaves out a potential source of conflict errors To: pgsql-bugs@postgresql.org From: wayne+psql@lewisclan.org Date: Thu, 21 Jan 2016 05:05:37 +0000 Message-ID: <20160121050537.2738.12242@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org The following bug has been logged on the website: Bug reference: 13878 Logged by: Wayne Lewis Email address: wayne+psql@lewisclan.org PostgreSQL version: 9.3.9 Operating system: Ubuntu 14.04 Description: In 25.5.2 of the documentation the reasons for conflict errors are listed. The first case is "Access Exclusive" which lists the ways an AccessExclusiveLock can be taken on master which could conflict with queries on the standby. I think it should be noted there that even a lazy vacuum (and specifically auto vacuum) can take AccessExclusiveLock when truncating free pages from a relation, and that lock can produce a "User was holding a relation lock for too long." error on the standby when the standby has long overlapping queries on that relation. I didn't realize until researching the source that auto vacuum can take an AccessExclusiveLock in lazy_truncate_heap() and I suspect most users do not realize that either. While documentation to this effect would be very useful, is it possible to go further and introduce a flag that disables truncation during lazy vacuum whenever there is a standby? If there is no consequence to leaving those pages I think users would prefer to control when an AccessExclusiveLock can sneak into the WAL. Thanks! Wayne -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs