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 1jOFTH-00023t-JW for pgsql-docs@arkaria.postgresql.org; Tue, 14 Apr 2020 06:54:59 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jOFTG-00012N-Eg for pgsql-docs@arkaria.postgresql.org; Tue, 14 Apr 2020 06:54:58 +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 1jOFTG-00012G-4F for pgsql-docs@lists.postgresql.org; Tue, 14 Apr 2020 06:54:58 +0000 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jOFTD-0004nr-Ix for pgsql-docs@lists.postgresql.org; Tue, 14 Apr 2020 06:54:57 +0000 Received: by mail-wr1-x442.google.com with SMTP id d17so6095341wrg.11 for ; Mon, 13 Apr 2020 23:54:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=WgmM1+TgKvnubpznFodieJr5rY0J66UlnNBcmkZaKMA=; b=qREI5i3L/zoY3GfT2+tGo8h1ujrRsV8oh1KSGN2k1yoNtP6biNWLpq2ZfZcsSvBL8V cD9DsGjwFG1p6IskxsDHJkGhFjhfaFmOtFdRB8hjfE/FNyTqVHqUIRF9OUtMfsaGa59H aQRMnzbUek11MixRk4LB+KelOdDYZiirGexkAiEKZ/qa6JFxQC2gBcNvgQju/k78mzyJ nn+3eq+n1GL1AhTVo7RuicDAt3x3WAHW28qEiBm4AH1d8OfnkxGzIs/oX7JT/wYV2jmT 1izeZFhJYk4dBHd45eCBHvo0yZzUxuGiQ97KsnWrls62FRO+Vv2oerKVW9fmLg/yNCPA 472A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=WgmM1+TgKvnubpznFodieJr5rY0J66UlnNBcmkZaKMA=; b=Rq8TWIdZZ2qZjYzkZkuuUka8Z/5IZc+VJmG44F7s5+kozUCDrUUPeksAPJL7EGAyQB qXf4BZ0LdFliP3Tsyg4t/NEeE+OuporoihNx8o8W4X5MB0G7JwMu6kHn2nlByi3T2za1 DPqlV5LV45xPfsY2P5CqWQbRiI4jzs2LHZJjZxaDjDzsF8LxGM9y326edR+3m9egHq9A zuZW/mvo5ynHBqHt1A+zIRTg+Sjm+4ffB5V/oyTl5rH4q6XyjiI6nJrN4TWFiIJvRbPV TcYI4ucEPR4KHduOpaJDDkSeKopClcsb0Cx77tnnnAXueyKNiOkgSyHUIDwXhs5NZhMj ajEA== X-Gm-Message-State: AGi0PuYpaCJT8vxZMgq/Ro4uowaxe1cm8FfMlc3yaitPsHHi/1+MJ/FQ KRK7taIJgIvCyTvfqX3ZPXp4oA== X-Google-Smtp-Source: APiQypL8jD+BiOoo8O8P6YRsb2foCmN0YdFZDYZ0a+RZmrod+s9abZe1eytBxF8PFc5QZAD0jFj5cA== X-Received: by 2002:adf:8b48:: with SMTP id v8mr23908767wra.342.1586847293773; Mon, 13 Apr 2020 23:54:53 -0700 (PDT) Received: from dynamic-elim6gqhhasxg5018-pd01.res.v6.highway.a1.net (dynamic-elim6gqhhasxg5018-pd01.res.v6.highway.a1.net. [2001:871:60:19ac:f3af:1770:ee76:36c]) by smtp.gmail.com with ESMTPSA id v7sm18650019wmg.3.2020.04.13.23.54.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 13 Apr 2020 23:54:53 -0700 (PDT) Message-ID: Subject: Re: Ambiguos statement in wal-async-commit page From: Laurenz Albe To: nilsocket@gmail.com, pgsql-docs@lists.postgresql.org Date: Tue, 14 Apr 2020 08:54:52 +0200 In-Reply-To: <158681229064.25695.12299508971635249207@wrigleys.postgresql.org> References: <158681229064.25695.12299508971635249207@wrigleys.postgresql.org> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.32.5 (3.32.5-1.fc30) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Mon, 2020-04-13 at 21:11 +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/12/wal-async-commit.html > Description: > > In this page: > https://www.postgresql.org/docs/current/wal-async-commit.html > > In this paragraph: > Certain utility commands, for instance DROP TABLE, are forced to commit > synchronously regardless of the setting of synchronous_commit. This is to > ensure consistency between the server's file system and the logical state of > the database. The commands supporting two-phase commit, such as PREPARE > TRANSACTION, are also always synchronous. > > > This is to ensure consistency between the server's file system and the > logical state of the database. > > Here I don't understand how inconsistency is introduced, if DROP TABLE or > PREPARE transactions is not logged. > Considering drop table is like any other transaction, the user is informed > that the table is dropped, and the system crashed, it didn't actually > perform the action of dropping table nor was it logged in WAL, then how it > would cause inconsistency. > Isn't it similar to losing any other last transaction, if not logged. Operations *are* logged even if "synchronous_commit" is "off". The difference is that the log is not flushed out to disk at commit time. Imagine you run DROP TABLE, and the transaction commits without flushing WAL. The file that belongs to the table is removed during the commit. Now if there is a crash, it could happen that the transaction didn't happen (because the WAL wasn't persisted yet), but the file is already gone. This would be data corruption. Yours, Laurenz Albe