Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pj6kl-0004Pu-RY for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 23:04:51 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pj6kk-0001fZ-HO for pgsql-hackers@arkaria.postgresql.org; Sun, 02 Apr 2023 23:04:50 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pj6kk-0001fP-8M for pgsql-hackers@lists.postgresql.org; Sun, 02 Apr 2023 23:04:50 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1pj6kh-000WmL-B3 for pgsql-hackers@postgresql.org; Sun, 02 Apr 2023 23:04:49 +0000 Received: by mail-pl1-x62d.google.com with SMTP id iw3so26328045plb.6 for ; Sun, 02 Apr 2023 16:04:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20210112.gappssmtp.com; s=20210112; t=1680476685; 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=2lGA3C7CI1YP3YNEAi9Oox4TryycFEsbQdhbKm87iks=; b=492J6PjfMz2GIUEaJOOabHKcyQAL2Tq+bFz5nJETxFW8UyuNr/OtmY7snqrUidaKKT Fz5qqO7W/DVIn0IZN6olYXRRv6lMnpy9hk7uN78gBojbj0qolWTnx+Ba3shLr4ViVz57 Gq81RYKKfrWSDNtCgj9gma1dZ7BzWgUR9hARkbRNhjKEbvxqLr06mxtSutJb73vodmoE J8JJ6tj3/iYL5uaCTktLk8wI+/76kV7SwNelQBRgn5fn6y8/UQ4lCdI2UNcIgzTCG+on 4LCOCOPZljmMcMZUFHKuvUbbw0lFdf8iOfkzufMizoT0m9pI41xkRW/SO+TTi8jE1egK 0miA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680476685; 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=2lGA3C7CI1YP3YNEAi9Oox4TryycFEsbQdhbKm87iks=; b=TF4b1H8a1lYi2Y/5tiGocpbQLAiyTJg8BidQoBlhGGll32xK9Qz/WRmc6B8H6J9XGe u9V8opDh0zTvWvCbIyJlIeYEvg2Ab4CT0JUFnGvncsLR98t5JxDPPhHv2yrpiKpj8GRp MIqjoLNnCgv34pb63/SzNR490CzJR6BxUDQAKjyNiyj5j7PeRE0eBo75CjvJAoc+AvBs LrmjWYzYQvo5r9w31yMEIyiVvSYgL8Zlqe6VFwLy183G99TirxRHoK6kJzMso8yUiPg2 sqhZ7/T9FsL8m5KeFdHv0YHPHbibIb+hNXf4cXBOKtOaLScJAfPiF6t8hRBSWknkgGvE ZBpw== X-Gm-Message-State: AAQBX9cUJL60Z7r5wkYOEzwvSY2Gfg23b24VSHD1jlzHMrHht6NeBzfH z3u+hW2b28G7wd54M0Zf+Wc8dA== X-Google-Smtp-Source: AKy350adAABHxHLfErmZljyCKWBxLaAKMay5SitIX1p/YAyVmmzGtgcUR81CFeh2tTTi/YbkLUNO0A== X-Received: by 2002:a17:90a:1906:b0:23c:fa83:2a7d with SMTP id 6-20020a17090a190600b0023cfa832a7dmr40989956pjg.12.1680476684844; Sun, 02 Apr 2023 16:04:44 -0700 (PDT) Received: from jeff-laptop.lan (c-73-170-46-202.hsd1.ca.comcast.net. [73.170.46.202]) by smtp.gmail.com with ESMTPSA id l20-20020a170903005400b001a1b66af22fsm5238295pla.62.2023.04.02.16.04.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Apr 2023 16:04:44 -0700 (PDT) Message-ID: Subject: Re: Minimal logical decoding on standbys From: Jeff Davis To: Andres Freund Cc: "Drouvot, Bertrand" , Robert Haas , Thomas Munro , Alvaro Herrera , Ibrar Ahmed , Amit Khandekar , fabriziomello@gmail.com, tushar , Rahila Syed , pgsql-hackers Date: Sun, 02 Apr 2023 16:04:42 -0700 In-Reply-To: <20230402222904.d3va24dwpr3mgbpj@awork3.anarazel.de> References: <061eeb26-156e-6011-02b6-b4b1422e2aa6@gmail.com> <8a7da0c2-b7fe-1c78-4e47-a16239bf4839@gmail.com> <6ab352de1553c1e3d0c7d97c038dc470ca51e772.camel@j-davis.com> <4df984c8-3adb-3b69-0e4e-a491097862ce@gmail.com> <20230402213506.ocprj6ky45s4ydtr@awork3.anarazel.de> <20230402222904.d3va24dwpr3mgbpj@awork3.anarazel.de> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.44.4-0ubuntu1 MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sun, 2023-04-02 at 15:29 -0700, Andres Freund wrote: > I agree that the *wait* has to go through condition_variable.c, but > it doesn't > seem right that creation of the WES needs to go through > condition_variable.c. The kind of WES required by a CV is an implementation detail, so I was concerned about making too many assumptions across different APIs. But what I ended up with is arguably not better, so perhaps I should do it your way and then just have some comments about what assumptions are being made? > The only thing that ConditionVariableEventSleep() seems to require is > that the > WES is waiting for MyLatch. You don't even need a separate WES for > that, the > already existing WES should suffice. By "already existing" WES, I assume you mean FeBeWaitSet? Yes, that mostly matches, but it uses WL_POSTMASTER_DEATH instead of WL_EXIT_ON_PM_DEATH, so I'd need to handle PM death in condition_variable.c. That's trivial to do, though. Regards, Jeff Davis