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 1mf1EH-0003Qz-Go for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 14:45:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mf1EG-00070U-Fn for pgsql-hackers@arkaria.postgresql.org; Mon, 25 Oct 2021 14:45:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mf1EG-00070K-7w for pgsql-hackers@lists.postgresql.org; Mon, 25 Oct 2021 14:45:36 +0000 Received: from mail-il1-x133.google.com ([2607:f8b0:4864:20::133]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mf1EE-0000nG-6L for pgsql-hackers@postgresql.org; Mon, 25 Oct 2021 14:45:35 +0000 Received: by mail-il1-x133.google.com with SMTP id 3so10710755ilq.7 for ; Mon, 25 Oct 2021 07:45:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=7pEswGR327FPYaFSTd4ekNp1X5OiC+2PsgrSi7iar6M=; b=MDribYOQgT788l4V11nHtHJdcDaBi52ieY23xPY5/iomO+5Iqah4aq0cUG1uapCmdV EF3vypJjonpm+Vz/Qxj1296FEgzS/MT8B44v0rput6eL5oVkXEzRJeE10ee/iR2XsqNl 8OfWfK4/aJKTelyEL9OAmN8fM65fxBULHgOGlzEWwTvcqlDzePqwPKEfocRyKpGWEqr/ 5r+0+lOujtPZ/K+LGNMbKHQDYlaLZlPV8XS96ViHMqk4kYCseT87+LJRdWbJOqoulF/i /GFfylIQ1hbWZtZG0kdKrjmJa0gIrLFpv1idgs11zxckwqDs3kuS8oBU1Gp5BZqsn4ZX qY4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=7pEswGR327FPYaFSTd4ekNp1X5OiC+2PsgrSi7iar6M=; b=j1Ox/iuwsdZ3puVTwQTQWhQqDYpNvCMe/dnRMAyk+yC+j64HJ/Pei0Lz6YFr/aSm3E xLw0GDcQZEihl+yZsmIwIEexSEl8UAx2svSXXyDLFxpYWW7SonO9ZOeCP2W/71+CGjg6 YbH3Z/NuiRamcWN8DIEsXhtJljq0PZcoEQL7WYnIo3KL7mfx7BXiAp0euAyETegMMTVo 6PYb2j+SLEhCwQGmEIzhH2onjcUjAymw0MoUJ0JHukJjJN7aOyKIpxGrgfe+Hanka2iZ EV2FIyBxFnY+PuRJH7NX5+UHEN1mJCz9nDpLkRbLnLjRGbg4gS2iqAtRV2t5ykBjwLwK 43cw== X-Gm-Message-State: AOAM531Bi9VILsDiOZpnYbYcFgE79Z7fT6pLIgkMjURMNKfVLH/9VbQJ 5kfa1D8rBxDIhgK68gcBqvLFZB2423f1Tra2A8Y= X-Google-Smtp-Source: ABdhPJzRQITcLXCYBJ7AmjtpNHEaKKeZqe8zvX9Nj8qYmR3p6TWa9Y6Oj4LxeZijxEmAH1+6WI/UDSvWxPqHqXSVqWE= X-Received: by 2002:a05:6e02:1ba5:: with SMTP id n5mr7332427ili.249.1635173133127; Mon, 25 Oct 2021 07:45:33 -0700 (PDT) MIME-Version: 1.0 References: <20211007002651.GA20716@ahch-to> In-Reply-To: From: Robert Haas Date: Mon, 25 Oct 2021 10:45:21 -0400 Message-ID: Subject: Re: [Patch] ALTER SYSTEM READ ONLY To: Amul Sul Cc: Jaime Casanova , Rushabh Lathia , Dilip Kumar , Andres Freund , Bharath Rupireddy , Ibrar Ahmed , PostgreSQL-development , Prabhat Sahu Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Oct 25, 2021 at 3:05 AM Amul Sul wrote: > Ok, did the same in the attached 0001 patch. > > There is no harm in calling LocalSetXLogInsertAllowed() calling > multiple times, but the problem I can see is that with this patch user > is allowed to call LocalSetXLogInsertAllowed() at the time it is > supposed not to be called e.g. when LocalXLogInsertAllowed = 0; > WAL writes are explicitly disabled. I've pushed 0001 and 0002 but I reversed the order of them and made a few other edits. I don't really see the issue you mention here as a problem. There's only one place where we set LocalXLogInsertAllowed = 0, and I don't know that we'll ever have another one. -- Robert Haas EDB: http://www.enterprisedb.com