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 1rX2KM-008R8K-J0 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Feb 2024 17:00:15 +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 1rX2KL-00Elar-K5 for pgsql-hackers@arkaria.postgresql.org; Mon, 05 Feb 2024 17:00:13 +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 1rX2KL-00Elai-7X for pgsql-hackers@lists.postgresql.org; Mon, 05 Feb 2024 17:00:13 +0000 Received: from mail-lf1-x12b.google.com ([2a00:1450:4864:20::12b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rX2KE-005Dm8-Bw for pgsql-hackers@postgresql.org; Mon, 05 Feb 2024 17:00:12 +0000 Received: by mail-lf1-x12b.google.com with SMTP id 2adb3069b0e04-5114fa38434so1361135e87.0 for ; Mon, 05 Feb 2024 09:00:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1707152404; x=1707757204; 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=LPM5fnyZYoCdmslnaEj3z8huSWdzbfSKebAv5d6hvqg=; b=VOi/Nz/kCbTznzIXxgPv5nrNBgwOGjVWKZ6YojQoxlY0ljk56stjmvT9dqZ+zVonYZ hgdc6G1NOhArrtuWISffPywJf8wlvbT+QSF5N4RQYkuSh+RvIH6/0dlnbOSghQYdRaya PWIKv+8JwLc9KPxfkA9xYHIpHQqq5s0zSxSgmVRFPFOJOO7flVQ4wpD2wKceR0RgRW2B JqDkGl4PErOnoImFGJ/W7+S7/Xpi1GEYMVi8hxpDqKLISioVE09cOeFRYaBqKjJ+jGve q7LquivLrGmC73z9tZqo5gO+GEeb4CsfgFWcDhBZmPzHuRFBFb0tXxL6+Taww0BNetBx T45A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1707152404; x=1707757204; 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=LPM5fnyZYoCdmslnaEj3z8huSWdzbfSKebAv5d6hvqg=; b=sp2SmkgYlttVF3fUJdA2enL8TmSef04dpLyRLE2vOn4WMRAeJwyTgJ2EdwNhdVLOfV 7FPMkevxvzyc0q/d4XmnULd2T/sNmRZHni2/7BWs+8HbAx2KqKZQTf/AOsV/xn0IhIk9 WWgkyDctqcIADU87JGiqxX354HLVivqJMNuu8q9NIyG+QHBPWEEDmbeyMzdSvx/FENxf lnhLiwrbLsJqeQ1X7ZXpUyQzTrOd7sC35LJxhIhpP/TWzojwqpByrAD/+Lf6wUYYnDCo Q11Kw9SYpz5lpd2gonlV6LStaHUSe7jii3+jEMOPu5E66OThMNRGNsKg5LakO0F68mZb Fq9Q== X-Gm-Message-State: AOJu0YwrIgAWxIyK3yKaJlVVhGWuieirVNYxbIC00S7Y1PPT3TMsUlRH jtDygq4HRKuN++TJ9oaR7zsv4w3wuxmgEABbuKos1Xl1ixHA0D43 X-Google-Smtp-Source: AGHT+IHRUWRnKD8+JxK4wslKsjInljrQjGTKRwR6vZZXZ73rSTNvAEHycw8KZuRM+bTtxJCbY0zaEA== X-Received: by 2002:a05:6512:3b20:b0:511:4ab5:a5dc with SMTP id f32-20020a0565123b2000b005114ab5a5dcmr164453lfv.44.1707152404331; Mon, 05 Feb 2024 09:00:04 -0800 (PST) X-Forwarded-Encrypted: i=0; AJvYcCXC/Zf1kzHo6Rzu99yj0s4N+gZN0MdbAAlUgf3bSmbGY8LVZ/jL2zBm3Hnfrp3Mi+GGlj3ihKEm9mkwz6zkgz9cKSjFmcMOTprEguqsCOlhpgi27eFkHXoh2TqKI2k7w8NCveFns/WHVpgRgJQ8EmBNkijiUqlmn2ERuJ5K7tyJ3p+WwcAeQ7VKF/JKpKhR+SPSJgy0DwViKJxaineVdf0Sdw5bCbsPiqXIqA4dgBuPZvYcyKXbJn0lqdkME+dwIog/gmeY/yQrHh3iapcZg/5KyqH3tWhTZTOCP/q4msGEahY6HlQeIzLH+JhCA+XDASh9XPtDtuiQk5RL9M/w4spgYwJZxWMASpCPN6+qrgvBr2eh9koavhraJgYR2m5pCBDW8oNsEvukK3/SlS3P3LLlQMDdO3zdJRxUBdhgUHW2vjwldC0T8ZKFYUE2eGDRTbF6wiJj2KWfOXf7AlA= Received: from [1.0.0.7] ([178.155.31.74]) by smtp.gmail.com with ESMTPSA id m4-20020a194344000000b005114f5e3b3dsm8458lfj.273.2024.02.05.09.00.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 05 Feb 2024 09:00:03 -0800 (PST) Message-ID: <96b7fa75-a63a-1af1-6c41-3d9baadec238@gmail.com> Date: Mon, 5 Feb 2024 20: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: On login trigger: take three Content-Language: en-US To: Alexander Korotkov Cc: Daniel Gustafsson , Tom Lane , Mikhail Gribkov , Michael Paquier , Robert Haas , Andres Freund , Greg Nancarrow , Ivan Panchenko , Teodor Sigaev , Ibrar Ahmed , vignesh C , Pavel Stehule , PostgreSQL Hackers , Amit Kapila , Masahiko Sawada References: <2133270.1698592561@sss.pgh.pa.us> <44807d19-81a6-3884-3e0f-22dd99aac3ed@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 Alexander, 05.02.2024 02:51, Alexander Korotkov wrote: > Usage of heap_inplace_update() seems appropriate for me here. It > avoids trouble with both TOAST and row-level locks. Alexander, could > you please recheck this fixes the problem. I've re-tested the last problematic scenario and can confirm that the fix works for it (though it still doesn't prevent the autovacuum issue (with 4b885d01 reverted)), but using heap_inplace_update() was considered risky in a recent discussion: https://www.postgresql.org/message-id/1596629.1698435146%40sss.pgh.pa.us So maybe it's worth to postpone such a fix till that discussion is finished or to look for another approach... Best regards, Alexander