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 1qlwJx-004wiw-PS for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 19:05: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 1qlwJw-00Fhwt-Dh for pgsql-hackers@arkaria.postgresql.org; Thu, 28 Sep 2023 19:05:08 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qlwJv-00Fhvi-W3 for pgsql-hackers@lists.postgresql.org; Thu, 28 Sep 2023 19:05:08 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qlwJt-007AGM-1J for pgsql-hackers@postgresql.org; Thu, 28 Sep 2023 19:05:06 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-5789ffc8ae0so9071905a12.0 for ; Thu, 28 Sep 2023 12:05:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20230601.gappssmtp.com; s=20230601; t=1695927903; x=1696532703; 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=SxdmW3wW8yEam/W6jz3mRLBQaWLMF8d/ZDoQgbmh+og=; b=0svUCsViRNfvzSMtZrauSDp7xn0PYdRclxucPW0wbVIKL56cHr0p0jBsPvsNui0GnM UIBAlYaP+7RtFJzrJ+9i51JHVaQ4CSvUqQyJNf2v7hPd2AlzkyTmWArXnQX2fNP+wekT Lq3eSvMvdZba6ckwSs1Ry1wHZrzHYtrcif88X6gXwPZohfhyaXstUHn5Vs2732njbSKh j+MV81qWNgRZMtr7/2Ky/Ow0FSSgot3UL4ra/RrS0b723rXLAHg1PT8IDnOhwMqPW6ph bctiFfr4FQlOr8jnjKJt69a1yYkJFAS0wS1kAtOhb2Rdjb0cvKOy8lbhfSif8iQUWZ7R RC+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695927903; x=1696532703; 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=SxdmW3wW8yEam/W6jz3mRLBQaWLMF8d/ZDoQgbmh+og=; b=YNSGPYzW/ZH7uVbV33TLKO2efHsyGxCTQFerh18RAFtNDVMVwfmPbOi3kPWRxLVpdj ESE+H8aokFpiGLzFlnGbjPZT0rPPmZyr0ipyovX0M/QLrP3HYRksz/FjjVoZQYECEueW RLqAW5mbeT4yQP01g4NDkZICXUovOiAlgebVf2TQSaenpCEr3/CzM+M390F9LJpaOa// JbmrmVx81k1U+jZ5PbOHfb6l+y3MwcMuo/RIzfXnBzzfZvkUT02HtEKnUtH0k5VcdH2d gmyaOBGWPrk0rIL2PNGTuQapj298WImedhj8ADqj0MFgwxsC0BCX4dnFZEsQnZ2K7ftd pB1w== X-Gm-Message-State: AOJu0YyOUXH0n38GLdR9zefRtkHkw+ta7ZpKHO1nzSBK7GhKNtKQpmWk B/rYMg9MlG0mMWZsjnaw9XcrDg== X-Google-Smtp-Source: AGHT+IF+lU4H6BQmANF6BJ4ECu6mY+IoY1ITHayStQKA23Pd82uiJZUN1cZTsmkYeS/MEkqCSk43IA== X-Received: by 2002:a05:6a20:7289:b0:14d:e075:fc5d with SMTP id o9-20020a056a20728900b0014de075fc5dmr2199229pzk.40.1695927903411; Thu, 28 Sep 2023 12:05:03 -0700 (PDT) Received: from ?IPv6:2607:fb90:3722:cefe:b5:7135:1c1b:ee9a? ([2607:fb90:3722:cefe:b5:7135:1c1b:ee9a]) by smtp.gmail.com with ESMTPSA id n5-20020a62e505000000b0065a1b05193asm13572309pff.185.2023.09.28.12.05.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 28 Sep 2023 12:05:03 -0700 (PDT) Message-ID: <57c59f08bbb92875251dc97dbc47600fa237712c.camel@j-davis.com> Subject: Re: Is this a problem in GenericXLogFinish()? From: Jeff Davis To: Heikki Linnakangas , Robert Haas Cc: pgsql-hackers@postgresql.org Date: Thu, 28 Sep 2023 12:05:00 -0700 In-Reply-To: <6d23aff2-7151-65b1-528b-2189ffa6e2df@iki.fi> References: <25104133-7df8-cae3-b9a2-1c0aaa1c094a@iki.fi> <399492009193fa2c37a61b630e4449546a550039.camel@j-davis.com> <146426fc662f88604c700a72a3833b1919922f9e.camel@j-davis.com> <08b4f1f7dcf321d38373f06acc65a8d62cc2f017.camel@j-davis.com> <6d23aff2-7151-65b1-528b-2189ffa6e2df@iki.fi> 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 18:57 +0300, Heikki Linnakangas wrote: > We could define a new REGBUF_NO_CHANGE flag to signal that the buffer > is=20 > registered just for locking purposes, and not actually modified by > the=20 > WAL record. Out of curiosity I also added a trial assert (not intending to actually add this): Assert(!(flags & REGBUF_NO_CHANGE) || !BufferIsExclusiveLocked()); I expected that to fail, but it didn't -- perhaps that buffer is only locked during replay or something? I don't think we want that specific Assert; I was just experimenting with some cross-checks we could do to verify that REGBUF_NO_CHANGE is used properly. Also, I ran into some problems with GIN that might require a bit more refactoring in ginPlaceToPage(). Perhaps we could consider REGBUF_NO_CHANGE a general bypass of the Assert(BufferIsDirty()), and use it temporarily until we have a chance to analyze/refactor each of the callers that need it. Regards, =C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0Jeff Davis