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 1uLzoP-0003Z3-Fy for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 07:42:25 +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 1uLzhh-008OhX-ET for pgsql-bugs@arkaria.postgresql.org; Mon, 02 Jun 2025 07:35:29 +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 1uLzLs-008EDm-Q3 for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 07:12:56 +0000 Received: from mail-wm1-x330.google.com ([2a00:1450:4864:20::330]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uLzLp-001KCb-19 for pgsql-bugs@lists.postgresql.org; Mon, 02 Jun 2025 07:12:55 +0000 Received: by mail-wm1-x330.google.com with SMTP id 5b1f17b1804b1-451dbe494d6so5928455e9.1 for ; Mon, 02 Jun 2025 00:12:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=deepbluecap-com.20230601.gappssmtp.com; s=20230601; t=1748848372; x=1749453172; darn=lists.postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=wNEOWGz9WpP4yMT0+/0QXBexOHRkEVSprTLJWT8X4/A=; b=Onnd0wSiSPwPMRe/ntMIhS2ASGoHtxpfUx1BGAulP64BrRocmjvwYYLMqfmu77RBU6 zyDERSDWX9LvZ2VXrvz5gmD+rRbwSxLw6y6cXZGnJso3uzDXicUCExlfWoTFuvpXONhE 88QCOv9UY7vPC10kTPh1Kqm54bwNGQLRSBvsOU9eCDIHVsgj2jfsenkKZg4j2nN88Wuv Xhwxf8dTejgfuNgEhZGBhEJ8w+kHNYL4O7Ak0/e1QvYQbc0cXK4FiwNz3W4zW/PMqpKg 0jJ3Avf7LCFgl9kdL0+w08zlgQV0pXxcKai16BEvMCrnR1T8w7EYWx6vUfHE8uWlTE+E 8wJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1748848372; x=1749453172; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=wNEOWGz9WpP4yMT0+/0QXBexOHRkEVSprTLJWT8X4/A=; b=jkEG0SBLbgpTquEgqnKJLNYQ4jDlrm0xKYXMpoacm9I0aLrPZ+YZcdQ15SKO6l/U6b 1QqEzC5Dg6G1jOEUUkqU+1Rdg5o/rVBsGdiAhrYOS/SO8ob1gm5ah5wpAWY47LIuQK59 EdIjPuehTBXzIVHTj0YZD5jsCFpMw1GCkr8MVfSQ3xB/cT+jYZK0HYAhEU1DscRZcLzf RzRXFXTyAVy07d14GKuhzhl3VXCi8qvDMVZpf0bIoqkDfN4iFT0gEOm8x2rw7VuI1nQj wpDRjigaEgLOT7j5PJsvI4R5CcuQ7sB79X8VjWhDIXZq0bHfhJAf5V4Y7EtD23aYI0mM FTUw== X-Gm-Message-State: AOJu0YxgZnC8gh59crFAI7VyHAaDWI+0xYMC0S/tolspsAV6TxwXUjCF SilwkfG9htFWA6rRfTNOHtE3XT9gp5Psin0pW9yMFEgSNgmgq49V2iYrQzZvTir6M/8= X-Gm-Gg: ASbGnct+IKOupOe3oBY71QxKRFVBlBrGPB8ntzBQaagQ0Diqk6tWl76Hw5SJGD6MDF/ yWOuu5HTUp/hXgE1yXUiF5LllaQEnVTN4pmpoTlrKRQyVAr4hZstF+QPEuhX96XT1NHYHc3QJFW 8SlJPYd/h86mB9vjZPvdDTH3zOIfOxl+JHnxwYccXaxuo/yeDLDfQ7HCg+vMfRXwtAS2rlhM7fa CLADmRlM/adhOu3qjD/mYM9yYHPMmu00KYUQYYUTBoPLDxZkxBiYfLtcGTY/34bzPAMeKDQDf82 ZLPz+cjugqN7YXwLhYhEKWZJ6N0KTSm0jccqwrIZBnq/QCqGuPvfbs2nSjVl9UJsI9l4LrBnLSz dR209zaG96wTZbhWpHoC8EYPRG4qm5uaPgrOEJ+8tUYs= X-Google-Smtp-Source: AGHT+IFiiRlYmKOBW1sh0s2bwgRTgX/ea//fcLh8PViAc2d7bIfnALEJoMn0s9+QYx0nLp7VOlUxhg== X-Received: by 2002:a05:600c:6219:b0:43c:ec97:75db with SMTP id 5b1f17b1804b1-4511ecc3e06mr59424775e9.11.1748848371622; Mon, 02 Jun 2025 00:12:51 -0700 (PDT) Received: from ?IPV6:2a01:e0a:255:1000:7e41:cdff:5856:e810? ([2a01:e0a:255:1000:7e41:cdff:5856:e810]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3a4efe73f01sm13490201f8f.45.2025.06.02.00.12.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 02 Jun 2025 00:12:51 -0700 (PDT) Message-ID: <61ccd3cd-3185-4b07-9ce4-738c91546b54@deepbluecap.com> Date: Mon, 2 Jun 2025 09:12:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Logical replication 'invalid memory alloc request size 1585837200' after upgrading to 17.5 To: "Hayato Kuroda (Fujitsu)" , 'Masahiko Sawada' , Amit Kapila Cc: "pgsql-bugs@lists.postgresql.org" References: <680bdaf6-f7d1-4536-b580-05c2760c67c6@deepbluecap.com> Content-Language: en-US From: Duncan Sands 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 Dear Hayato Kuroda, I tried v4-PG17-0001-Avoid-distributing-invalidation-messages-sev.patch and I can confirm that it also resolves my original issue. Best wishes, Duncan. On 28/05/2025 14:27, Hayato Kuroda (Fujitsu) wrote: > Dear Sawada-san, Amit, > >>> It can impact the performance for large transactions with fewer >>> invalidations, especially the ones which has spilled changes because >>> it needs to traverse the entire list of changes again at the end. >> >> Agreed. >> >>> The >>> other idea would be to add new member(s) in ReorderBufferTXN to >>> receive distributed invalidations. For adding the new member in >>> ReorderBufferTXN: (a) in HEAD, it should be okay, (b) for >>> backbranches, we may be able to add at the end, but we should check if >>> there are any extensions using sizeof(ReorderBufferTxn) and if they >>> are using what we need to do. >> >> If we can make sure that that change won't break the existing >> extensions, I think this would be the most reasonable solution. > > Based on the discussion, I created PoC for master/PG17. Please see attached. > The basic idea is to introduce the new queue which only contains distributed inval > messages. Contents are consumed at end of transactions. I feel some of codes can > be re-used so that internal functions are introduced. At least, it could pass > regression tests and workloads discussed here. > > Best regards, > Hayato Kuroda > FUJITSU LIMITED >