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 1nTaeq-0002o9-L4 for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 02:42:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nTaep-0003dO-AL for pgsql-hackers@arkaria.postgresql.org; Mon, 14 Mar 2022 02:42:03 +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 1nTaeo-0003dE-VB for pgsql-hackers@lists.postgresql.org; Mon, 14 Mar 2022 02:42:03 +0000 Received: from mail-pj1-x1033.google.com ([2607:f8b0:4864:20::1033]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nTaem-0006QD-P0 for pgsql-hackers@lists.postgresql.org; Mon, 14 Mar 2022 02:42:01 +0000 Received: by mail-pj1-x1033.google.com with SMTP id z12-20020a17090ad78c00b001bf022b69d6so13153333pju.2 for ; Sun, 13 Mar 2022 19:42:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=tJKAertS/prRIp2n4Q+OqBtU9q/0PMOMUllAhEwG9js=; b=Olc8Hzfb8pCcXP4LRxKOWqiQTD6CIxEK2CktWT60OlyITwxe+L2ny4iirP4vkceqx7 trvMFPjq4xwQ/qc7/njOc/4QeKDLNmwhgZrDWQE52YpYaNT37JFx0IWi/3rx2azXuGbl kgvnyA44JYph/bHha/oZOP1uXgEBtp3OrMzwUX4U9bv7qEyD//twJ3AXr07mkP4tNrwH BmTE8VgXPtTmXiWY9D97PtvS5LtW4pDL9xDXhkyok6l2cm23yXbWynairg4o3M5Ochol bqLSZuqTjn4uzJkHYitDi4Ev67AgAVOhYIlExrAB203KLXyRsSANz0UsUV2YFtPqyb/W Y34w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=tJKAertS/prRIp2n4Q+OqBtU9q/0PMOMUllAhEwG9js=; b=coseCQRssYgKT8m1bt2vnqdtOiOVUJysdm5wd/4vGOOB4Q2k+919YTbOBO8if259OJ y++X+DK3s382FC1JEs0oAXTQ+7JvW+YGjt82Zzv8X5KG7f3K5snmImG+jOt0GRLP2NLt qBelCqnkZyxHDVgPDK25wTHTwcmx30eG73Jt6tZxaeI/TKQkjr7zqSrZgfPUBBWV4W4Y zhV3k80rBeXSYnwSq0enO+1payff+0QacQHlVs+7T9OeT1uOql14zhf6pDtIKZoppEIt ye/hblz6+obilUUpwNAGwGym0ECZyzaD3LyK40seDpDQpVRsAkyArIyDjFWeGDoYqhX+ SCyA== X-Gm-Message-State: AOAM533Zz9xG9L24f2VCcvaH/U+ERo5dmJmWOqLOMJ9lc7/zS+7oigNT oRd31Vp3lOq2aBo3Pa+5x0o= X-Google-Smtp-Source: ABdhPJzlXCrObDyoSTNccXcdBKjfbu9IryuI8VZQLDp1spaClWNZ9M9/d8DDca6vQJnZAtxIWJn1oA== X-Received: by 2002:a17:90a:4604:b0:1bc:8bdd:4a63 with SMTP id w4-20020a17090a460400b001bc8bdd4a63mr34012403pjg.147.1647225718253; Sun, 13 Mar 2022 19:41:58 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id b10-20020a056a00114a00b004f784ba5e6asm11387106pfm.17.2022.03.13.19.41.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 13 Mar 2022 19:41:57 -0700 (PDT) Date: Mon, 14 Mar 2022 11:41:55 +0900 (JST) Message-Id: <20220314.114155.1987239955710692813.horikyota.ntt@gmail.com> To: nathandbossart@gmail.com Cc: andres@anarazel.de, bharath.rupireddyforpostgres@gmail.com, satyanarlapuram@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Allow async standbys wait for sync replication From: Kyotaro Horiguchi In-Reply-To: <20220314.113002.1607014104756351937.horikyota.ntt@gmail.com> References: <20220309020123.sneaoijlg3rszvst@alap3.anarazel.de> <20220312223332.GA921069@nathanxps13> <20220314.113002.1607014104756351937.horikyota.ntt@gmail.com> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Mon, 14 Mar 2022 11:30:02 +0900 (JST), Kyotaro Horiguchi wrote in > At Sat, 12 Mar 2022 14:33:32 -0800, Nathan Bossart wrote in > > On Tue, Mar 08, 2022 at 06:01:23PM -0800, Andres Freund wrote: > > > To me it's architecturally the completely wrong direction. We should move in > > > the *other* direction, i.e. allow WAL to be sent to standbys before the > > > primary has finished flushing it locally. Which requires similar > > > infrastructure to what we're discussing here. > > > > I think this is a good point. After all, WALRead() has the following > > comment: > > > > * XXX probably this should be improved to suck data directly from the > > * WAL buffers when possible. > > > > Once you have all the infrastructure for that, holding back WAL replay on > > async standbys based on synchronous replication might be relatively easy. Just to make sure and a bit off from the topic, I think the optimization itself is quite promising and want to have. > That is, (as my understanding) async standbys are required to allow > overwriting existing unreplayed records after reconnection. But, > putting aside how to remember that LSN, if that happens at a segment > boundary, the async replica may run into the similar situation with > the missing-contrecord case. But standby cannot insert any original > record to get out from that situation. regards. -- Kyotaro Horiguchi NTT Open Source Software Center