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 1o7OJq-0006iQ-15 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 21:36:54 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1o7OJo-0003Ud-Rj for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Jul 2022 21:36:52 +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 1o7OJo-0003US-Gt for pgsql-hackers@lists.postgresql.org; Fri, 01 Jul 2022 21:36:52 +0000 Received: from mail-pj1-x1031.google.com ([2607:f8b0:4864:20::1031]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1o7OJm-0008F0-5V for pgsql-hackers@postgresql.org; Fri, 01 Jul 2022 21:36:51 +0000 Received: by mail-pj1-x1031.google.com with SMTP id g16-20020a17090a7d1000b001ea9f820449so7649846pjl.5 for ; Fri, 01 Jul 2022 14:36:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0MEr7ZD/YxYbJkMLkQ/toP9fYsgGuE0VdyPpG67p/6w=; b=JndBVyiFHw4NXbyb9no32wwMbs1ZHXNhLITDIwVcZB2wgOUU3tmhipFFOJ6c0U8hJH +jbKuNT/hB/UhErTXycgcc6mJ+CLjjSx1WaG7x0V9sXAM92HY5nfECvPzyaidHRs2+LC tF13AEe602/SPRPQ6pi97DgXX/FcJ5JM7cjB7ZO5G+6EHtZ1Xkanhqm+z5RQTkmYKlMA +gPvjm/OPY3j4uT+3t1L4oS+bJa62nLHdoQ/dN3aF79z5tpsEm+08zI9jr645eyYcdI8 BFdnwrOAfqaUSs6NmZbhNOPruNicVWUO3wVSIpitJL+WiYLMvAr+OlNDEmhm93EQdG1P SuKw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0MEr7ZD/YxYbJkMLkQ/toP9fYsgGuE0VdyPpG67p/6w=; b=51rlGhAP5fOooLdOiDDz1/T6ut3kUImbfEPpYsckgdYnLP1JI4lYlNWzP+AFMD6o1L WGfKwPrTOi9wQuPkRRSp8X4apCRhawXXtLywkd/+KFL/VEjR9BLYMOEROvaibUheHtQ8 no9NiOM3qqfVfbSbu4ZxJ3gbK+h74MZcAGKKewkNq5ERM0/2eMW1hirEPQ1SO3r7zL6o ABn+hr1bk77tYljl9Ib4Wm1vKmRGpjr7bSBX0LHN8QrjBcCf4lUFNHVubY4IVwTkCZVt EXshyz2aTWskqZu1HAZBv92TSJLi+sb794p3kBxV1w8RMBcglLf6owgjR3YFqvoacBB2 whvQ== X-Gm-Message-State: AJIora/OUtvinVxixAufnER42QRHa0AAV8TXkTR1Y9FMtKy0sokLd+z3 d6zOY+seJkvbi5bgi1yFYVANzeTQbAo= X-Google-Smtp-Source: AGRyM1sLEOPq4SVUwUTLMTLt+fT/LaBsGj3Sau0YNmSPsZGXitUgNLLik2u1Pu1HMSz/PjY79P04Gw== X-Received: by 2002:a17:90b:3d0f:b0:1ed:3b8c:7cb1 with SMTP id pt15-20020a17090b3d0f00b001ed3b8c7cb1mr19260647pjb.44.1656711409217; Fri, 01 Jul 2022 14:36:49 -0700 (PDT) Received: from nathanxps13 ([50.54.155.70]) by smtp.gmail.com with ESMTPSA id u9-20020a170902e5c900b0016760c06b76sm7863011plf.194.2022.07.01.14.36.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Jul 2022 14:36:48 -0700 (PDT) Date: Fri, 1 Jul 2022 14:36:46 -0700 From: Nathan Bossart To: Peter Eisentraut Cc: pgsql-hackers Subject: Re: refactor some protocol message sending in walsender and basebackup Message-ID: <20220701213646.GA582729@nathanxps13> References: <7e4fdbdc-699c-4cd0-115d-fb78a957fc22@enterprisedb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7e4fdbdc-699c-4cd0-115d-fb78a957fc22@enterprisedb.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 23, 2022 at 04:36:36PM +0200, Peter Eisentraut wrote: > Some places in walsender.c and basebackup_copy.c open-code the sending of > RowDescription and DataRow protocol messages. But there are already more > compact and robust solutions available for this, using DestRemoteSimple and > associated machinery, already in use in walsender.c. > > The attached patches 0001 and 0002 are tiny bug fixes I found during this. > > Patches 0003 and 0004 are the main refactorings. They should probably be > combined into one patch eventually, but this way the treatment of > RowDescription and DataRow is presented separately. All 4 patches look reasonable to me. -- Nathan Bossart Amazon Web Services: https://aws.amazon.com