Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3cAs-0004hz-Ux for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 06:45:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f3cAq-0004Vz-Ro for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Apr 2018 06:45:36 +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.89) (envelope-from ) id 1f3cAq-0004Vp-EV for pgsql-bugs@lists.postgresql.org; Wed, 04 Apr 2018 06:45:36 +0000 Received: from forward5j.cmail.yandex.net ([5.255.227.23]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f3cAi-0005rc-JO for pgsql-bugs@postgresql.org; Wed, 04 Apr 2018 06:45:35 +0000 Received: from mxback13j.mail.yandex.net (mxback13j.mail.yandex.net [IPv6:2a02:6b8:0:1619::88]) by forward5j.cmail.yandex.net (Yandex) with ESMTP id A399520C13; Wed, 4 Apr 2018 09:45:23 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback13j.mail.yandex.net (nwsmtp/Yandex) with ESMTP id lVJZvn1esU-jLROsEa9; Wed, 04 Apr 2018 09:45:22 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zsrv.org; s=mail; t=1522824322; bh=zleUw6twjHlMoVucCbUZyTj9HaURFXnfHj73ySG3Lko=; h=From:To:In-Reply-To:References:Subject:Message-Id:Date; b=pJdlEMmQiXlgQ90+ShqhyNMPuz4kaTX1EOgc0fMDIrk9iqMF2Z3YMcf076K68tzar PddC7wCR/x+MZZxpCkIGgqtB0wpKbILGJXxh0lOhWEPGJs5rM2fxvnes9lG0mjc9JR ytHbhcXJUS51YUVIDB2yxGdxNM0Sq6bxDnT1PNgo= Authentication-Results: mxback13j.mail.yandex.net; dkim=pass header.i=@zsrv.org Received: by web50j.yandex.ru with HTTP; Wed, 04 Apr 2018 09:45:21 +0300 From: Sergei Kornilov To: =?utf-8?B?55+z5YuH6JmO?= , "pgsql-bugs@postgresql.org" In-Reply-To: <020adf37a8d54e79b0b797590252a24b@pingan.com.cn> References: <1147541522765130@web44j.yandex.ru> <020adf37a8d54e79b0b797590252a24b@pingan.com.cn> Subject: =?utf-8?B?UmU6IOetlOWkjTogYXV0b3ZhY3V1bSBjYW4gbm90IHJlbW92ZSBkZWFkIHR1cGxlcw==?= MIME-Version: 1.0 Message-Id: <2899571522824321@web50j.yandex.ru> X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Wed, 04 Apr 2018 09:45:21 +0300 Content-Transfer-Encoding: 7bit Content-Type: text/plain List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Hello Yes, any session in transaction will prevent vacuum some rows. Regardless DISABLE_PAGE_SKIPPING or any other option, this is not bug. Vacuum should not remove any deleted row which can be accessible by any running transaction. You can use idle_in_transaction_session_timeout to prevent long idle in transaction state. But i use simple crontab like this: */10 * * * * psql -d postgres -tx -c "SELECT pg_terminate_backend(pid),now(),now()-xact_start as duration,* from pg_stat_activity where (now() - pg_stat_activity.xact_start) > '1 hour'::interval and usename NOT IN ('postgres') and state<>'idle'" to terminate any long running transaction. Time interval changed by database workload, for web requests can be 5min. regards, Sergei