Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XWV0v-0001RX-B4 for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 18:40:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XWV0u-0004bB-Qj for pgsql-bugs@arkaria.postgresql.org; Tue, 23 Sep 2014 18:40:36 +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 1XWV0t-0004b4-Q3 for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 18:40:35 +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 1XWV0m-0007ey-MC for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 18:40:33 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1XWV0l-0000M1-FU for pgsql-bugs@postgresql.org; Tue, 23 Sep 2014 11:40:27 -0700 Date: Tue, 23 Sep 2014 11:40:27 -0700 (PDT) From: ddv To: pgsql-bugs@postgresql.org Message-ID: <1411497627467-5820183.post@n5.nabble.com> In-Reply-To: <1411494429599-5820171.post@n5.nabble.com> References: <1402622597307-5807143.post@n5.nabble.com> <1411492718058-5820168.post@n5.nabble.com> <1411494429599-5820171.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 > Secondly, where do you run "select txid_current() into res1" and "select txid_current() into res2" ? It does not matter where. Important to count the number of transactions that takes place during max_standby_streaming_delay. Example res2-res1 = 25000, my value vacuum_defer_cleanup_age = 40000 > Even if you set MASTER vacuum_defer_cleanup_age to certain value, > autovacuum still can kick in anytime and may conflict query on the target > table. So setting vacuum_defer_cleanup_age to a value can really reduce > the chance of such situation? Due to this parameter, at the time when Autovacuum clean the dead rows they will be dead on the slave, and thus no queries will not use them. Therefore, the conflict will not be. > Moreover, in my post, the vacuum is on pg_statistic toast area, why did it > block queries on SLAVE? Autovacuum serves all tables, including a pg_catalog. This problem occurs on any table. For example pg_class or my_table. Autovacuum remove rows in moment AccessShareLock, this is row and unlock AccessShare receive to slave with WAL. WAL not recorded on slave due to a conflict recovery. At the same time queries are waiting for a lock on the slave. -- 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-tp5807143p5820183.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