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 1mOP7L-00030K-K1 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 18:49:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mOP7K-0001e5-I5 for pgsql-hackers@arkaria.postgresql.org; Thu, 09 Sep 2021 18:49:46 +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 1mOP7J-0000YI-Rq for pgsql-hackers@lists.postgresql.org; Thu, 09 Sep 2021 18:49:46 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mOP7C-0004ku-Rd for pgsql-hackers@postgresql.org; Thu, 09 Sep 2021 18:49:43 +0000 Received: by mail-pj1-x1034.google.com with SMTP id g13-20020a17090a3c8d00b00196286963b9so2204938pjc.3 for ; Thu, 09 Sep 2021 11:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Nxit7u9R61w2RGO6vF8nFZapOdl5mKcHH19mORblC6U=; b=iRPVP/zmK0YqL/oLSb9/wc0z2HxTjOLNd0g2er5I1a4Eaad9N3XPhEBD4WPR5rNn8y DjOWPklbGQ0vPc9xIE1xaThglvbk8bCW5h6RBssDzmD+bGDkjkhG1ETZKkrSTxW2jrWQ scWf7OPQv8YdbRCLmmrMpqZmYqoZF7xl3XIz78o13i3nWLHC+nSH8+gqQoPaFyiNXKZ5 7qHfC31R2j4Kfr0n/o8FTfJoN51/U2W8IHhb46tzXhWQLyqktqHy0nkjIKt4EhDw7Jgj oTHPQW7ogQH3NoFC2Z4Vev8wyF422LvIooAXB4cDNuN/hX+jVEdot8S2hQY5+sMvkc6s 2SIA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=Nxit7u9R61w2RGO6vF8nFZapOdl5mKcHH19mORblC6U=; b=5mPmo6gGgW8Ssn/ZDLYeMhJBcTpYRMOIPQ99ZNeqS3Gwswb2TnvB4tOz2LuXRROet0 6Ds9u+SUR+eikiLO/Aum0ltV6zoM9qo6S2lkQcaWzpNhv18fwA3vNbouZThtJWFz8j8M u8Wxy4f6srUQK3AGKOPGyz19DreekI28663fqF0wTIAdnaQrTNtZeTOEvQI15EqZr0Xu /mJZd/aW5slj4yREfDFNDo7CsLGZ5B/8527zgIOr9d34w0/PA5MqTwVBov+R1BbLE0VV +aXVhOCKrkaJ7CFsYNkwf18KxZ2yavT9x9Owj5OTrZyOOnR21t3yAsCVWAvmuT2M3Vj9 Vehg== X-Gm-Message-State: AOAM532rTNxIgE2QILG0CAy7QP2lZU5YEirNDAn22QilXF/xBFDXAiBm wSIbHHKuok/py0ix6XZrq/W0XzGwmqocKnLEUI9PRAdRcpYmQttEAW2bZhHjYhB2fUXdEhChGrW ol0vXYcDS476AUuZJZykcy1UHgpdCXyyh3xkefHjTh6g0wznv3WfcbN++567ECOip8GHpWWC81z PLLs3Gr65DQ9QxQKw24lB34paIAPVSkWYOprjZ X-Google-Smtp-Source: ABdhPJwwHH/Xx27sGh9XIVR6DE9/ipMCxUm0wKv6nAjG2WHzl0VeoiLo+bcEvDTu2xxKEVUr5JLJDQ== X-Received: by 2002:a17:902:dacc:b0:135:7ac:b790 with SMTP id q12-20020a170902dacc00b0013507acb790mr4201752plx.5.1631213376057; Thu, 09 Sep 2021 11:49:36 -0700 (PDT) Received: from laptop280-ma-us.hitronhub.home (24-113-193-150.wavecable.com. [24.113.193.150]) by smtp.gmail.com with ESMTPSA id u2sm2805765pjv.10.2021.09.09.11.49.35 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Sep 2021 11:49:35 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.7\)) Subject: Re: [Patch] ALTER SYSTEM READ ONLY From: Mark Dilger In-Reply-To: Date: Thu, 9 Sep 2021 11:49:34 -0700 Cc: Amul Sul , Andres Freund , Bharath Rupireddy , Dilip Kumar , Ibrar Ahmed , PostgreSQL-development , Prabhat Sahu Content-Transfer-Encoding: quoted-printable Message-Id: <2452D6AC-FEF2-4F59-9329-EAF6267A0C7C@enterprisedb.com> References: <20201210003428.sy5tx55v5x242hrf@alap3.anarazel.de> <20210217022026.qvsh4z4g3fklatzq@alap3.anarazel.de> <40622BA0-9299-459B-B222-8D885A45DF78@enterprisedb.com> <70C6534A-A04C-4318-A6E3-A2A1A788E172@enterprisedb.com> To: Robert Haas X-Mailer: Apple Mail (2.3608.120.23.2.7) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 9, 2021, at 11:21 AM, Robert Haas = wrote: >=20 > They have to check whether WAL has become prohibited > and error out if so, and they need to do so before entering the > critical section - because if the problem were detected for the first > time inside the critical section it would escalate to a PANIC, which > we do not want. But that is the part that is still not clear. Should the comment say = that a concurrent change to prohibit wal after the current process = checks but before the current process exists the critical section will = result in a panic? What is unclear about the comment is that it implies = that a check before the critical section is sufficient, but ordinarily = one would expect a lock to be held and the check-and-lock dance to = carefully avoid any race condition. If somehow this is safe, the logic = for why it is safe should be spelled out. If not, a mia culpa saying, = "hey, were not terribly safe about this" should be explicit in the = comment. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company