Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XWTjf-0006Sp-LK for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 17:18:43 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XWTje-0004n4-LB for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 17:18:42 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XWTjd-0004mb-Uw for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 17:18:42 +0000 Received: from sam.nabble.com ([216.139.236.26]) by makus.postgresql.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.80) (envelope-from ) id 1XWTja-00065c-Jm for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 17:18:40 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XWTja-0003Rn-2E for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 10:18:38 -0700 Date: Tue, 23 Sep 2014 10:18:38 -0700 (PDT) From: ddv To: pgsql-bugs@postgresql.org Message-ID: <1411492718058-5820168.post@n5.nabble.com> In-Reply-To: <1402622597307-5807143.post@n5.nabble.com> References: <1402622597307-5807143.post@n5.nabble.com> Subject: Re: automatic vacuum on pg_statistic pg_toast area blocks all queries in hot standby MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.8 (/) 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 Hello. What happens on the master: 1. A typical request puts a AccessShareLock on the table. 2. Autovacuum puts cleans dead entries from the table. This is possible because AccessShareLock does not conflict with ExclusiveLock. http://www.postgresql.org/docs/9.1/static/explicit-locking.html 3. Autovacuum finish successful. 4. Unlock AccessShareLock. What happens on the slave: 1. From WAL puts a AccessShareLock on table. 2. From WAL recovery Autovacuum result, but there is a conflict. WAL don't recovery, waiting time seconds from parameter max_standby_streaming_delay before canceling queries. 3. Queries waiting unlock AccessShareLock. Unlock does not occur because of paragraph 2. 4. Queries canceling by statement_timeout or conflict recovery. 5. WAL recovery and unlock AccessShareLock. If enable hot_standby_feedback then master also waiting slave time seconds from max_standby_streaming_delay parameter. Solution: 1. Disable hot_standby_feedback. 2. select txid_current() into res1 3. Waiting seconds. 4. select txid_current() into res2 5. Change postgresql.conf on master. vacuum_defer_cleanup_age = res2 - res1 + reserve. Good luck. -- View this message in context: http://postgresql.1045698.n5.nabble.com/automatic-vacuum-on-pg-statistic-pg-toast-area-blocks-all-queries-in-hot-standby-tp5807143p5820168.html Sent from the PostgreSQL - bugs mailing list archive at Nabble.com. -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs