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 1h24Is-0003Jg-2J for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2019 01:28:02 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1h24Iq-0008BF-Qj for pgsql-hackers@arkaria.postgresql.org; Fri, 08 Mar 2019 01:28:00 +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 1h24Iq-00089N-ET for pgsql-hackers@lists.postgresql.org; Fri, 08 Mar 2019 01:28:00 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h24Io-0003n7-3M for pgsql-hackers@lists.postgresql.org; Fri, 08 Mar 2019 01:27:59 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6CAA221BD6; Thu, 7 Mar 2019 20:27:57 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 07 Mar 2019 20:27:57 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=tkJ25EGsk95wrt/9p8JbQhyAhdv Gm1jvg/Pu0/BNNOc=; b=jW6WJNnmFY6eSFrnnE8ONbXFOthzK8TVq+q7ZldXXJu 6EKp3XVkrH5iRH18QNHDphOTRk/Cm8tWC0GxFxJciPY3KRBlu6zxTJQ0RkxmWVli 4yXF9uO8byYYyyZdcT/9OyYlPMBvuHLW5iHxy5XSSxUgkd3kLbzYabbQ4EI1Kx59 ZHnBOit1GGQ+TP8Z8VugkftUQ+Sk9jkCpX2rgfXuB9pCbar7wGJSLv4YGZJNG35y +KFkSad+arb2d7ej3NCmUjWjmKnuC6sP8BT385yUTzhz0PNSkqmlcJqvQUC2eKOE LxTC4qUHITUHgIaXI0gAw1Oh7gmZ2oeXzOw945T1SNQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=tkJ25E Gsk95wrt/9p8JbQhyAhdvGm1jvg/Pu0/BNNOc=; b=0Tp/C9YBm2T7idvrRHSIcJ q4fc1MAaPjqQDeGKq/4Kc/m1TnrOGlMo2vWy4u6G+rIIpp9ieut0CWO2owbuQnbx 6InEqaK/DEESBcEbmZs3LbSSQHW2g4IqW5ghVWRZ1+6vHF0IzREqsW124j4HNYV1 AOKMaR5ZMit9KZZSYc+YPS5jsFGwbRq0bqY0zOSLeazo8OLftFYK+wwMQ6irCrgF RIus/BYqUSIG3Z3+Q2a5gKP2FwCIfeuLU2tjKK2GUyCZMNP0bKIN1pcO2ZdP5xbh gS/xtXDiFh7oJwnWGcYczqtyLI0jmYMUvJoen7RaGIalcdInklzc6WKfzWky8n2Q == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfeelgdefudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduudekrddvgedurddvgeelrddugedunecurfgrrhgr mhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiiinecuvehluh hsthgvrhfuihiivgeptd X-ME-Proxy: Received: from paquier.xyz (mp76f1f98d.ap.nuro.jp [118.241.249.141]) by mail.messagingengine.com (Postfix) with ESMTPA id AC46510319; Thu, 7 Mar 2019 20:27:55 -0500 (EST) Date: Fri, 8 Mar 2019 10:27:52 +0900 From: Michael Paquier To: Robert Haas Cc: Postgres hackers Subject: Re: pgsql: Removed unused variable, openLogOff. Message-ID: <20190308012752.GC4099@paquier.xyz> References: <20190306235251.GA17293@paquier.xyz> <20190307141116.GC26628@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="mJm6k4Vb/yFcL9ZU" Content-Disposition: inline In-Reply-To: <20190307141116.GC26628@paquier.xyz> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --mJm6k4Vb/yFcL9ZU Content-Type: multipart/mixed; boundary="nmemrqcdn5VTmUEE" Content-Disposition: inline --nmemrqcdn5VTmUEE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Mar 07, 2019 at 11:11:16PM +0900, Michael Paquier wrote: > If you want to keep this formulation, that's fine for me. However you > should really change it to nleft as you suggest, and not keep nbytes. After sleeping on it, let's live with just switching to nleft in the message, without openLogOff as that's the second time folks complain about the previous code. So I just propose the attached. Robert, others, any objections? Perhaps you would prefer fixing it yourself? -- Michael --nmemrqcdn5VTmUEE Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="xlog-nbytes-fix.patch" diff --git a/src/backend/access/transam/xlog.c b/src/backend/access/transam/xlog.c index 0fdd82a287..9ab0efb0bb 100644 --- a/src/backend/access/transam/xlog.c +++ b/src/backend/access/transam/xlog.c @@ -2504,7 +2504,7 @@ XLogWrite(XLogwrtRqst WriteRqst, bool flexible) errmsg("could not write to log file %s " "at offset %u, length %zu: %m", XLogFileNameP(ThisTimeLineID, openLogSegNo), - startoffset, nbytes))); + startoffset, nleft))); } nleft -= written; from += written; --nmemrqcdn5VTmUEE-- --mJm6k4Vb/yFcL9ZU Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlyBxRgACgkQnvQgOdby QH19sw//cKp4Fsm+hrCnp/jX7Um/RbkNbu1N8OpKNXodOo4LwgmTG0vN/YjgmMiD EKvICx8NoHVX3tHNX4aZUuHa++o3+tsBwLlA8Xy2IazIOm6yw+bzVpfqXMHQNxb7 kYQibFk2CgnORl2oNG40emYSyti4cCclJYeqn3N45iUHDTQdDvGnT7VE3wP0eFLm kKYI+zxQYclTXzhLClVARpN6nDy9trhrBkZJa0j2Nka8otF4RlolsiwpRl3HLg08 sxotBb1/leb+z/qdhevcyxCpgOVNsc9qeQiS8zdlYUjsxn+y6fboT+fUv1Y12Z0m wXPc/fro6ZJNd0KQOdzoSyHuA8Px5lPcORALBtZiNPSqGQpZbty7r9joQhRHTSAe ZtKHnm+2u2Iwz/xc1g0cixHY2ymhi8jmaSSsCCZ5Ra2GYwkNZNePbv1WsJZlYttL 3TXPCXk4w0G4UEpiMQgtEaIlwYyvsUy2DyRXOf4c3Ja78f1gj8R1MUzzK3ufAf03 ivbK0N3Un83eoAVWczOorZVWEmPyoxvH73L/uxnNwlUqJjTeb2Qh0gr0bpxii9SJ 8MtABqbvvBOwAItrslnqDSFSVrvjsBJC6jPkE41dijM7VzXvsoh+dKpXPU6kp1qu kUzwm3tzCLsuFA9hvM2e3gQa/vrGwaIBoB30kiT9UxJsnFeFP1w= =8Hrl -----END PGP SIGNATURE----- --mJm6k4Vb/yFcL9ZU--