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 1tArJG-000U1o-7x for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:51:57 +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 1tArJD-006ZeN-Kp for pgsql-hackers@arkaria.postgresql.org; Tue, 12 Nov 2024 13:51:56 +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 1tArJD-006ZeF-5A for pgsql-hackers@lists.postgresql.org; Tue, 12 Nov 2024 13:51:55 +0000 Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tArJA-001Ua5-Mi for pgsql-hackers@postgresql.org; Tue, 12 Nov 2024 13:51:54 +0000 Received: by mail-qk1-x731.google.com with SMTP id af79cd13be357-7b15d330ce1so442165185a.1 for ; Tue, 12 Nov 2024 05:51:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wi3ck-info.20230601.gappssmtp.com; s=20230601; t=1731419511; x=1732024311; darn=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=oE2ZTCPdtHuV7T9czBS8erBA/erKYppNhL0cmg06z8o=; b=sM2aoER7tRYy2XmLFjnUja54yAvcy6GBYqFn4QORegN2kEWUyf0W4lrqw9CoGsXyGp ve0psbS9crdwkIXLk7hhiE5wS8iHSudoD21/E6DpJrqva2LhdEwzXnKuFpRmo1IcuB84 tz7wbIAAVpSO2onaTMsDYboZmoawLJNeCWmti/p/djgOOu+XpMjIrGOCnhmWzGp79+/Y 6SYmG/ZXQ7+ZyxbmpZZk/bZME5DOdKKHv7RgR4u8Le/cI/dPHEFiwidqjtq4D68j44M+ d11ZjuwC0o4HPs0sDQRnGSbL3ZNsOaOWmwbeYiLBWLZCsgxNRXKbKeRhqJ/ac4A7FFLZ 8Kcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731419511; x=1732024311; 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=oE2ZTCPdtHuV7T9czBS8erBA/erKYppNhL0cmg06z8o=; b=JJ96v1ToHH5DP7ZcM6FlrKX5ewpKKFTcoy7wy0jLBkEVEEB3VjkzmuRzPlosbIWhOU bQxrBd2IFLoOKeDofKvTYzMI0gaYZ4+wIBeAzlEzWcQ+rkgkrM3jHG4BSxK4+0iesGFv xqHHd9JyfgW3ttCV0L91KM/Zfeauzs96DsrhR70BEH6GFq31s37DN7ZLVdPx+apiPYzg iExIJpnLQyrBbke06sF8v7cRCXRv7zPZ/D+ZR/TjY/qzxY/EajZHT+RRqEgXG/AsPd9K sfYv8+rBqjoNCiu9OPvFo/BP652aOsN9zSqGWBnsaEKNdtG3YS0nMp61vKhIzRfm7hQ6 a9Pw== X-Forwarded-Encrypted: i=1; AJvYcCULZ8Md4frwuVqQXsLcQLlpMFCtaTsIio3yPysj6LugnzN6ZrWgm6Q3uAbqbYFnU6baOh3IseqF/GvD3f9s@postgresql.org X-Gm-Message-State: AOJu0YxflhC7aFwLH1EfhegxFMiiG4uTw/9x0njYTOPJJ4phZq1UZpFS idj043SYWwIFbc+SloF89bClGaP+VJnrd3okumJvyKSaX4zc3F6bWQ+5H7BykBc= X-Google-Smtp-Source: AGHT+IGJKQilpXltZy2eIY7mBBY748D7OSJ2+xjxsE0jwF5b34GDnGOdrSDkrXj0e77vDPfVC0CHUw== X-Received: by 2002:a05:620a:3729:b0:7b1:53ed:ae61 with SMTP id af79cd13be357-7b331dd37famr2267811985a.33.1731419511679; Tue, 12 Nov 2024 05:51:51 -0800 (PST) Received: from [172.21.0.10] (pool-108-16-53-81.phlapa.fios.verizon.net. [108.16.53.81]) by smtp.gmail.com with ESMTPSA id af79cd13be357-7b32ace8bd6sm589665785a.116.2024.11.12.05.51.50 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Nov 2024 05:51:51 -0800 (PST) Message-ID: <00f7cfb2-e3a6-4bd7-b19c-fd75d3838049@wi3ck.info> Date: Tue, 12 Nov 2024 08:51:49 -0500 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: Commit Timestamp and LSN Inversion issue To: Amit Kapila , Tomas Vondra Cc: Andres Freund , "Zhijie Hou (Fujitsu)" , Aleksander Alekseev , pgsql-hackers , shveta malik , Jan Wieck References: <9f7f4def-7ea8-4ad3-83e7-a8cc9d18c58a@wi3ck.info> <11ee3489-40ba-45d6-ba6a-7c3def725e84@vondra.me> Content-Language: en-US From: Jan Wieck 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 On 11/11/24 23:21, Amit Kapila wrote: > As the inversion issue can mainly hamper logical replication-based > solutions we can do any of this additional work under spinlock only > when the current record is a commit record (which the currently > proposed patch is already doing) and "wal_level = logical" and also > can have another option at the subscription level to enable this new > code path. I am not sure what is best but just sharing the ideas here. It can indeed be reduced to one extra *unlikely* if test only for commit records and only when WAL level is "logical". Without those two being true there would be zero impact on ReserveXLogInsertLocation(). It is not possible to do something on the subscription level because it affects global behavior of all backends. Best Regards, Jan