Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8em9-00B0pO-09 for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Nov 2023 11:00:09 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1r8em7-00Ghjw-Of for pgsql-hackers@arkaria.postgresql.org; Thu, 30 Nov 2023 11:00:07 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1r8em7-00Ghjo-F1 for pgsql-hackers@lists.postgresql.org; Thu, 30 Nov 2023 11:00:07 +0000 Received: from mail-lj1-x22e.google.com ([2a00:1450:4864:20::22e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1r8em5-009Kz5-0v for pgsql-hackers@postgresql.org; Thu, 30 Nov 2023 11:00:06 +0000 Received: by mail-lj1-x22e.google.com with SMTP id 38308e7fff4ca-2c9d4afb7dfso383301fa.1 for ; Thu, 30 Nov 2023 03:00:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701342004; x=1701946804; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=EBMpmubs0985NvRqrmdZ/M20qAZvQykdYYPysyHrdx8=; b=k8DFVfdpVnNDPqg/gvNGZaBq11MzLr0SLZXoVU+zGr+Nyyy7csZsV/c6tQ3tOXgdU1 ofTFsGzkvRrvMAVm3Pl9+WJ5taXb3667oEeSt0fYICixyygPVWTyVh4bHaN+rf/IvmK7 vMz3ZSeZzbgSPyFe+IKjI1Si5POYrhS24AuHacYtMdUXPnWs3CKk0iJOVA3PelndcUiv RUtdlM48+KKuEq/pBNC98wwXOgmJszLjC5x29xq25C0RdpqGMeoZtmJ9H4hVQJ5Q3XTs 5cHIXwiJmVjJD9eKX+WIxZaBXXySBtvfDFBmHG9fQSmyw+uog9NwHkV8FkrEfKtQ5G9X bQsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701342004; x=1701946804; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=EBMpmubs0985NvRqrmdZ/M20qAZvQykdYYPysyHrdx8=; b=R7CIc6Phwzt6UnoiPs0QASi4K9Qod9zgI9ElNVqjHo0ozFrJ+0YDexahA3OMZp8YJ6 dehcMB7tknZ2I+FkQSxyaKoqfKyMIUcH9rtO77+Vk/oXKDTUol1kPNgXxRYPd2AybfYV fr0fUikC+nipfXybOWdTiUgySig9HWodjj/9xSRRGrLJbFvus4NcGIf5rIug2tMDhjqr CjABKR0/LzKiSgztKsqyhfJoPXEcUoHioExU+61Ald1FUDaKqKa6yRRIfkcye0aRDiWQ aw1hQq+aP3J0nEk9D11tGzhrHvg+7xQljxNNRLKVjB5aW51j52dCmW9OP4BFK0WUXY28 G+MQ== X-Gm-Message-State: AOJu0Yzehe85eYSt8E64nhPCF1L1X/J32GCwtdrvAa4SBcOvNE2JUqAP HHjQP8NtIpHSz/LUaDAUUwc= X-Google-Smtp-Source: AGHT+IECrWNLj2/tmPylBiHQwI9Zq4XVrY1JSjbq2YWIK07aWNpIZzUx3ajJahCBxjL+/TatYrYlRg== X-Received: by 2002:a2e:8859:0:b0:2c9:b188:49b3 with SMTP id z25-20020a2e8859000000b002c9b18849b3mr5912397ljj.40.1701342003675; Thu, 30 Nov 2023 03:00:03 -0800 (PST) Received: from [1.0.0.7] ([178.155.22.198]) by smtp.gmail.com with ESMTPSA id o3-20020a2e7303000000b002c9c85f8414sm109074ljc.6.2023.11.30.03.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 30 Nov 2023 03:00:02 -0800 (PST) Message-ID: <9aa385d8-fe75-c35b-cf91-31bb3647d977@gmail.com> Date: Thu, 30 Nov 2023 14:00:01 +0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: Is this a problem in GenericXLogFinish()? Content-Language: en-US To: "Hayato Kuroda (Fujitsu)" , 'Amit Kapila' Cc: 'Michael Paquier' , 'Robert Haas' , 'Jeff Davis' , 'Heikki Linnakangas' , "'pgsql-hackers@postgresql.org'" References: <62ed1a9f-746a-8e86-904b-51b9b806a1d9@gmail.com> From: Alexander Lakhin In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello Kuroda-san, 30.11.2023 10:28, Hayato Kuroda (Fujitsu) wrote: > Again, good catch. Here is my analysis and fix patch. > I think it is sufficient to add an initialization for writebuf. I agree with the change. It aligns hash_xlog_squeeze_page() with hash_xlog_move_page_contents() in regard to initialization of writebuf. Interestingly enough, the discrepancy exists since these functions appeared with c11453ce0, and I can't see what justified adding the initialization inside hash_xlog_move_page_contents() only. So I think that if this doesn't affect performance, having aligned coding (writebuf initialized in both functions) is better. > I want to add a test case for it as well. I've tested on my env and found that proposed > tuples seems sufficient. > (We must fill the primary bucket, so initial 500 is needed. Also, we must add > many dead pages to lead squeeze operation. Final page seems OK to smaller value.) > > I compared the execution time before/after patching, and they are not so different > (1077 ms -> 1125 ms). > > How do you think? I can confirm that the test case proposed demonstrates what is expected and the duration increase is tolerable, as to me. Best regards, Alexander