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 1kwvg1-0004NP-4O for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 23:23:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kwvg0-0001x9-2w for pgsql-hackers@arkaria.postgresql.org; Tue, 05 Jan 2021 23:23:44 +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 1kwvfz-0001vI-Mm for pgsql-hackers@lists.postgresql.org; Tue, 05 Jan 2021 23:23:43 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kwvfw-0004ex-FR for pgsql-hackers@postgresql.org; Tue, 05 Jan 2021 23:23:42 +0000 Received: by mail-pj1-x1031.google.com with SMTP id l23so601204pjg.1 for ; Tue, 05 Jan 2021 15:23:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:mime-version :content-transfer-encoding; bh=xfgbkv3Ivl/hoXCNlkG0oC/qFnRh1N42nvc2jLSPIEk=; b=bbOs5Cm81bg62TsrJYaGbsSabWLtuR5rpx2PRyI62H4mk5b1oKHEch7IaABSKdg4aD Fsk3pca5isgVCpXfd8+kIdwRcLI2OTOZecAugWwNgNFVWEplLukNyfoy82G0NV1BF8BB 8k5ScMPdO6HYvUNvUfMQOCqQ+zzDxQuwFwM70MFPRiHWqqfjjVGeeCrIDnjUrKtpOEd7 IHskwDyJJJRLEVi0wJ8ffxT99bocBkNB4U4T2VNi037TQ4V9mLOy88n7bhOgPSdOoy6F hwF4C3K4zZz9LeheW7oTGLOAohRa/YI/orqUjmZdEDf0cqbBbdyywhH5B+uwZyqjWdnd aPhA== 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:mime-version:content-transfer-encoding; bh=xfgbkv3Ivl/hoXCNlkG0oC/qFnRh1N42nvc2jLSPIEk=; b=cGrsv+o8i5zbc/UcNRHpdP3sWAV+zFhKF23LyNT/1J5niMHFwAQ+Mt4FZLzyAyxbvh i4dvUJBAN093SQxeApwpTZb4mCtNrwf7vTF1tTz5zQ6G+PQI4uQcWX5HIMXNVEN9Ekwj kwNqevr22WYMHksIBpKl6q6buc9ER7Ihuzmz10jUV0HgcdZKllmxMEk/eG9u5z09l+66 ON3xmS7pH/IjcEmyQ90iNakSA1fbRXgJwT7HSZVcWF08v3BSNEjm1zIDYzoqAaG3Pum0 vUU9K2y+gschiY4tA2BuPHt3ACpc6iWt8yOqtqs1hPVZWe/ThYaq6XuUILCWayv61pNr m7iQ== X-Gm-Message-State: AOAM530Gwm/1vnYmEAeW+RWeSvjkpSXnTxROA20mMQO7xlBp9XPqdRx+ f7mtgd+00NOCAdRO04jzmriyiYQlHiHCXA== X-Google-Smtp-Source: ABdhPJwW8z0pX0zt62x9Qhjbu2o5zWf2Xfcg4gPZCqKuwK03iMkwS8e77VhSgewfxbloVpKZTgQxmA== X-Received: by 2002:a17:90b:3698:: with SMTP id mj24mr1380557pjb.149.1609889017590; Tue, 05 Jan 2021 15:23:37 -0800 (PST) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id b19sm404317pfo.24.2021.01.05.15.23.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 05 Jan 2021 15:23:36 -0800 (PST) Message-ID: <2c686eeeff7049e7500303248502aaebd876c649.camel@j-davis.com> Subject: Re: Replication protocol pipelining edge case From: Jeff Davis To: pgsql-hackers@postgresql.org Date: Tue, 05 Jan 2021 15:23:34 -0800 In-Reply-To: <0a2c985ebcaa1acd385350aeba561b6509187394.camel@j-davis.com> References: <0a2c985ebcaa1acd385350aeba561b6509187394.camel@j-davis.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, 2021-01-05 at 09:17 -0800, Jeff Davis wrote: > The reason I ask is because it makes clients that do pipelining more > complex. If the server always enters copy mode, then the client can > send a CopyDone and then pipeline more requests behind it. But if the > server may or may not enter copy mode, then the client needs to wait > until it sees a CopyBothResponse before any new requests can be > pipelined. In an offline conversation with Andres, he pointed out that we can never be sure that we'll enter COPY mode, because the START_REPLICATION command could throw an error. Therefore we need to always wait for the CopyBothResponse, and can't pipeline any new commands until we get it. Regards, Jeff Davis