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 1uk2Fc-00EvrY-EQ for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Aug 2025 15:09:52 +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 1uk2Fa-005Siw-VX for pgsql-bugs@arkaria.postgresql.org; Thu, 07 Aug 2025 15:09:50 +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 1uk2Fa-005SiS-Mc for pgsql-bugs@lists.postgresql.org; Thu, 07 Aug 2025 15:09:50 +0000 Received: from mail-ej1-x632.google.com ([2a00:1450:4864:20::632]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uk2FY-001HTH-12 for pgsql-bugs@lists.postgresql.org; Thu, 07 Aug 2025 15:09:50 +0000 Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-af937728c3eso373024566b.0 for ; Thu, 07 Aug 2025 08:09:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1754579387; x=1755184187; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1qXnK8CLqWW6YJw7mY63b90nb7iQa3Sag6pzctQFQ/o=; b=Sk5evX3t5kc8GoNBpEJNfDeSilMRa9uvZtf59aDags30A8Y9+BAZTEsaNpj0+CMl28 T9HG0gCcYVFZ5vvMkiSUx3D20s/j9Hra0UcEXIylQe5LOvGvKBjWnrFhbOaGbWBAatmo SsQx6zCfFayg/O8MR+PtneGoed4s9mz9T4yddOkQUBRXYDo0MOrLBjcpuJhpRje0dBz3 mgEIspLeidvfj0OCHFFAQdWrUleN7Iwi7JsZEP/ojgsWGWMz4SPJEXWvlV9CjkW2MsK9 ODf1fs8RZvGs7+p1XUP1LCbBdj86fQXT8cmVTdm8HzgAOz0quarQoYn4wldDFNax7Cwf uGbg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1754579387; x=1755184187; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1qXnK8CLqWW6YJw7mY63b90nb7iQa3Sag6pzctQFQ/o=; b=rs357NEU9CKRcsEDiVq0UOMKhAGP5tBXhXh9SQ8w/Ln9y2HZ71KJP/MS1TmJbIAgL+ uI8J7cndH6Ut0kyKR1P3sGuj4ydZ4pZj6rsE8z0GdxJGPl2akVCPGf01EQV/3imn2HML XWROz9D9K/Gziyl+gdW9m+aGzCrXYOlN/tIM4hLfV/Rn6NqO4y11wAjNN5iSaaTwHfQl K3BRcTF4OFKpqzw0Ts8y32mnC6XYo/Bxwh7sdw3PXM2NYbqQGIZuCDV2zf+zrgVsVG37 msD14A1I3wCRfxGuhey/Bz0WntXXmo22GzmXoPZef4gFKw8XHMxAEuxlF+u7lq/eqTYg jEjA== X-Forwarded-Encrypted: i=1; AJvYcCWDAD1DD80s+tuBV0AKXVJp9SiUlXPzciw0sF4wn1UIuhZVFdMMcBr2QBzbmP28FFhDuQxiS2nbI3qA@lists.postgresql.org X-Gm-Message-State: AOJu0YwVxVanQcTnieVyoIBZh/9ogEkOCnD4wSy3R8IC7oVi9tEC714x LHXEZnUYv9CWlUE05f1o45U0uotAPz9NJxfpRd6Pv3gBGen+iujZIw1totlP9UH328neRkBvLBN ph+dDcPupRg4tArzduplgzhheWnbSXFE= X-Gm-Gg: ASbGnctMvDxuDfeUzmboBRhv13My9AAa3FDbB/4hEtrYT9dL7UEJXXTXmBSjw8384A0 NhC+InzTfquMBbb9IgD4QsDToyRd/Z7AlNt7pUWrdCoq4PRv2ps9X4DInM/IfNfjO3ktFsR2wj4 /2dpdR8PEOytqr0g+peRASSrA+lBJKFANxXjI6S39fZcP0yn8xq3BNSqEGeaxcSiBbCEaKE0YgE fVvFA== X-Google-Smtp-Source: AGHT+IHKgjAkb+fQRPmb6Y9v4167/iQ5C2H16Ugx0PIT+memoOxTSSEA2yaf3ruQ7a8oz6c3FrAHwy6XKfF0WMwWDUc= X-Received: by 2002:a17:906:36d7:b0:af9:bfed:fbae with SMTP id a640c23a62f3a-af9bfee01efmr53070566b.10.1754579387183; Thu, 07 Aug 2025 08:09:47 -0700 (PDT) MIME-Version: 1.0 References: <19006-80fcaaf69000377e@postgresql.org> In-Reply-To: From: Xuneng Zhou Date: Thu, 7 Aug 2025 23:09:34 +0800 X-Gm-Features: Ac12FXzSY0HIpVt6vOH_B6l_CXXYS7wehNjw5EbkXN1QBpRpMsnydD55jNMYMPs Message-ID: Subject: Re: BUG #19006: Assert(BufferIsPinned) in BufferGetBlockNumber() is triggered for forwarded buffer To: Thomas Munro Cc: exclusion@gmail.com, pgsql-bugs@lists.postgresql.org, Michael Paquier , Tom Lane Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Aug 5, 2025 at 12:29=E2=80=AFPM Thomas Munro wrote: > > Here's my proposed fix. Great reproducer, Alexander, thanks! I tested the fix, it works well now. I tried to review the code logic but found it hard to figure out this line on my own due to the unfamiliarity with this module currently: stream->buffers[stream->queue_size + stream->oldest_buffer_index] =3D InvalidBuffer; Could you please elaborate on it a little bit more? Thanks. Best, Xuneng