Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icdBd-0001gr-AJ for pgsql-general@arkaria.postgresql.org; Wed, 04 Dec 2019 22:31:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1icdBb-00036Q-OX for pgsql-general@arkaria.postgresql.org; Wed, 04 Dec 2019 22:31:55 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1icdBa-00032M-Pw for pgsql-general@lists.postgresql.org; Wed, 04 Dec 2019 22:31:55 +0000 Received: from resqmta-ch2-02v.sys.comcast.net ([2001:558:fe21:29:69:252:207:34]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1icdBT-00050D-O6 for pgsql-general@postgresql.org; Wed, 04 Dec 2019 22:31:53 +0000 Received: from resomta-ch2-08v.sys.comcast.net ([69.252.207.104]) by resqmta-ch2-02v.sys.comcast.net with ESMTP id cTc4iCewJ3dZccdBQioPsl; Wed, 04 Dec 2019 22:31:44 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=20190202a; t=1575498704; bh=YNdUY3qwJwGyOVPTZMJD7xl74kvR7GM5KKYBkpZVvlo=; h=Received:Received:Received:From:To:Subject:Date:Message-ID: MIME-Version:Content-Type; b=bX5JyB3ayyfIuulHb6rjQTect+b1GT3fdSYCWqc6mRyAJ6JcZlU/JpBahaziIoMtn KJwBOXfjfadQ8WbdgOdiLKtGRfsVv2RZdJgn2+0LRo3xyBpkdxBCRT2BZsmZOQBfAL bb3EONlaDLiVlAVmfwUqo0k8QzK0jSs7/kAWACDB0S7LV06ufAmumKbcGW/r2LJQ3D yq8AvKhOJxW89nBL+9p0hZd5IPO7DyPGgt2wtJ4mh3Mj4RMFxAMCVzJnoJiZs4Szna uqU2RJrcjURN4po0zfWyWJvPn1Kpd0xW2DgmOxP3tQ7LL5oGPVmkt73qNcLhsoQIpR K8JA6+kAP4adw== Received: from jsievers.comcast.net ([12.187.116.132]) by resomta-ch2-08v.sys.comcast.net with ESMTPA id cdBHiUimQ4s0BcdBIiA5Pp; Wed, 04 Dec 2019 22:31:42 +0000 X-Xfinity-VAAS: gggruggvucftvghtrhhoucdtuddrgedufedrudejledgudehlecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucevohhmtggrshhtqdftvghsihdpqfgfvfdppffquffrtefokffrnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffufhffjgfkfgggtgfgsehtqhertddtreejnecuhfhrohhmpeflvghrrhihucfuihgvvhgvrhhsuceoghhsihgvvhgvrhhsudelsegtohhmtggrshhtrdhnvghtqeenucfkphepuddvrddukeejrdduudeirddufedvnecurfgrrhgrmhephhgvlhhopehjshhivghvvghrshdrtghomhgtrghsthdrnhgvthdpihhnvghtpeduvddrudekjedrudduiedrudefvddpmhgrihhlfhhrohhmpehgshhivghvvghrshduleestghomhgtrghsthdrnhgvthdprhgtphhtthhopehprghtrhhitghirgdrhhhusehfihhnrhgrrdhorhhgpdhrtghpthhtohepphhgshhqlhdqghgvnhgvrhgrlhesphhoshhtghhrvghsqhhlrdhorhhgnecuvehluhhsthgvrhfuihiivgeptd X-Xfinity-VMeta: sc=-100.00;st=legit Received: from jsievers.enova.com (localhost [127.0.0.1]) by jsievers.comcast.net (Postfix) with ESMTP id 5F3DC26005A; Wed, 4 Dec 2019 16:31:35 -0600 (CST) From: Jerry Sievers To: "Hu\, Patricia" Cc: "pgsql general \(pgsql-general\@postgresql.org\)" Subject: Re: what causes xact_rollback for a database in pg_stat_database to increment? References: Date: Wed, 04 Dec 2019 16:31:35 -0600 In-Reply-To: (Patricia Hu's message of "Wed, 4 Dec 2019 20:48:38 +0000") Message-ID: <87r21joh88.fsf@jsievers.enova.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk "Hu, Patricia" writes: > We=E2=80=99ve been seeing over 200k rollbacks being recorded for a databa= se > at certain hour overnight but can=E2=80=99t see the corresponding ROLLBACK > statements being recorded in postgresql db logs, even though our > log_statement is set to ALL. > >=20=20 > > I did some tests and confirmed that xact_rollback count increments in > scenarios below and am looking further at those. > > 1. a ROLLBACK is issued explicitly or implicitly(if a > transaction or pl/pgsql block/function raises an exception or was > aborted) > > 2. it doesn=E2=80=99t reflect the number of records being rolled ba= ck > > 3. even if ROLLBACK statement results in WARNING like =E2=80=9Cther= e is > no transaction in progress=E2=80=9D, it increments > >=20=20 > > Does anyone know on top of his/her head any (other) explanation for > such unaccounted for rollbacks? Dangling session... begin; select this; select that... HTH > >=20=20 > > Thanks, > > Patricia > >=20=20 > > Confidentiality Notice:: This email, including attachments, may > include non-public, proprietary, confidential or legally privileged > information. If you are not an intended recipient or an authorized > agent of an intended recipient, you are hereby notified that any > dissemination, distribution or copying of the information contained > in or transmitted with this e-mail is unauthorized and strictly > prohibited. If you have received this email in error, please notify > the sender by replying to this message and permanently delete this > e-mail, its attachments, and any copies of it immediately. You should > not retain, copy or use this e-mail or any attachment for any > purpose, nor disclose all or any part of the contents to any other > person. Thank you. > > --=20 Jerry Sievers Postgres DBA/Development Consulting e: postgres.consulting@comcast.net