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 1qlW5w-0039bK-5E for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Sep 2023 15:04:56 +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 1qlW4w-000ZlW-1B for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Sep 2023 15:03:54 +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 1qlW4v-000ZlH-IC for pgsql-hackers@lists.postgresql.org; Wed, 27 Sep 2023 15:03:54 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qlW4s-007uaI-JZ for pgsql-hackers@postgresql.org; Wed, 27 Sep 2023 15:03:53 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-1c5ff5f858dso57280815ad.2 for ; Wed, 27 Sep 2023 08:03:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1695827028; x=1696431828; darn=postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=lCgfJpWhPzM9gqVYqx3XoMUwshpwmz9jhebEogEdQM0=; b=UbCdEJwiIh6M8RF7S14wZIjtCxYKyv66xBuTazSu/P6RVSt5W2UODDFV/afLA3MP55 LvV7tBP2jN2hs4pNwr7kihlJLhEW7IuOImrd9K/5hifZTLykRxd9NE6X0+46tyCc2tfN 1R3kvx7dH4wfxWLUD7xFQwWBGrNTa4rJoP2udmFcKsPZuMVoN0IIM4p/5ZdQJZ2yIbvP 7Cmj78ftctZcImI6nNuR2ZQaYe48TK5E83Oa8WA1r4IK30GaxeECv2uHFLSnWSXpO+0W Uex0QuPLHooDVKDUy9E4I7PZDMEAOX3eNN655eLB3AuXvvIJmbJ8MaMN2idG/LHwVNW9 1vpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695827028; x=1696431828; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=lCgfJpWhPzM9gqVYqx3XoMUwshpwmz9jhebEogEdQM0=; b=egooTXzwKHb9GSxMeiEZ2hVDCr4XCB9WcMfxkjzoTxogjek4vUElmJ/1o/IwXBkuRy C4EPXGqcdWivtNvq28AQ02qX72idiwAYPl3y25Sp4oFabnYOfxZUF/Mks3eeDPrxg2+c iCJyi9l4hv55JH9ukEV5GsvJQMy41oUDygZBcInel9aKFYz0TXfWJa4MQWFd47gXFcTY hphKNul/wmfg+gYf3mDIktZiHyoduu8c7SBJJHtd2YFixinlMXsTKioThtuTxtuH58X/ b7eVATT87Bz9+sF6XiLVhT9hBEx99V2bb45c2dvdZ8Vam5+XaOU6TJkpP4OzZNDhB/KF 30Qw== X-Gm-Message-State: AOJu0YyatdzvNv2AhwjzGXOdSFcTSmQN14f+8b9WzHT+L+O2lTd5d7Un OwEpKTRjfa4QfDLOynWcDP2AAg== X-Google-Smtp-Source: AGHT+IF6wbAm3v31NfH7abU8RXLU4jZn+teOQejcxoaN82d41QhvpJA7G0PoCdG7+cccFHxCdUsWKg== X-Received: by 2002:a17:902:d48e:b0:1c1:e4f8:a5a9 with SMTP id c14-20020a170902d48e00b001c1e4f8a5a9mr2378214plg.34.1695827027940; Wed, 27 Sep 2023 08:03:47 -0700 (PDT) Received: from jeff-laptop.lan (c-98-45-81-55.hsd1.ca.comcast.net. [98.45.81.55]) by smtp.gmail.com with ESMTPSA id e1-20020a170902d38100b001acae9734c0sm1643397pld.266.2023.09.27.08.03.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Sep 2023 08:03:47 -0700 (PDT) Message-ID: <08b4f1f7dcf321d38373f06acc65a8d62cc2f017.camel@j-davis.com> Subject: Re: Is this a problem in GenericXLogFinish()? From: Jeff Davis To: Robert Haas Cc: Heikki Linnakangas , pgsql-hackers@postgresql.org Date: Wed, 27 Sep 2023 08:03:45 -0700 In-Reply-To: References: <25104133-7df8-cae3-b9a2-1c0aaa1c094a@iki.fi> <399492009193fa2c37a61b630e4449546a550039.camel@j-davis.com> <146426fc662f88604c700a72a3833b1919922f9e.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu2 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, 2023-09-27 at 10:36 -0400, Robert Haas wrote: > On Tue, Sep 26, 2023 at 9:36=E2=80=AFPM Jeff Davis wr= ote: > > That site is pretty trivial to fix, but there are also a couple > > places > > in hash.c and hashovfl.c that are registering a clean page and it's > > not > > clear to me exactly what's going on. >=20 > Huh, I wonder if that's just a bug. Do you know where exactly? hashovfl.c:665 and hash.c:831 In both cases it's registering the bucket_buf, and has a comment like: /* * bucket buffer needs to be registered to ensure that we can * acquire a cleanup lock on it during replay. */ And various redo routines have comments like: /* * Ensure we have a cleanup lock on primary bucket page before we start * with the actual replay operation. This is to ensure that neither a * scan can start nor a scan can be already-in-progress during the replay * of this operation. If we allow scans during this operation, then they * can miss some records or show the same record multiple times. */ So it looks like it's intentionally registering a clean buffer so that it can take a cleanup lock for reasons other than cleaning (or even modiying) the page. I would think that there's a better way of accomplishing that goal, so perhaps we can fix that? Regards, Jeff Davis