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 1pcfsi-0002ww-J1 for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 05:10:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pcfsf-0002s5-MJ for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Mar 2023 05:10:25 +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 1pcfsf-0002rv-BP for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 05:10:25 +0000 Received: from mail-lf1-x129.google.com ([2a00:1450:4864:20::129]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pcfsX-00037a-Tq for pgsql-hackers@lists.postgresql.org; Thu, 16 Mar 2023 05:10:24 +0000 Received: by mail-lf1-x129.google.com with SMTP id j11so800652lfg.13 for ; Wed, 15 Mar 2023 22:10:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1678943417; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=EmTP7Nszw5DzIV9C5l+yn4hKF4OG14vjtpD+cv7ruPQ=; b=p4nzaf8mbrFq+lYmiZy2UaRsz+hEscdhc3153kiZ71G0KUcQ2feLVLnvc/7yFVvza1 A1Qkn1g1t558bYiJVwAPzRWFNrKro8fIwfKLTW0mkyDHZ3OCUFpXHvyaKUOlGeOXD6ya oksO6JK2VgagoZZ615YsuQSyxgWFT1y8WtJ2bGtcFB3boga3+zOI0RcyarSk2Gm4wyEG 0aodTlNoR2S6fjGEdyrTge/QJMM35KhKqls7N9pGZDuFxBSy8ku6Rv3MyMqTF3Zbx8YN sBuoBWBShm2SVa2vpmweknCcnTOLrd8+A9qbWWrSWp93AQeU6jKX/1ElXx6YFpgADYLq qRLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678943417; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EmTP7Nszw5DzIV9C5l+yn4hKF4OG14vjtpD+cv7ruPQ=; b=QQ+9/IFp3CtLCFjB+JtByTus768Z09zYSXEIIbsSDQNKBodc9P04VHpkEjdYtILw0m BVGHXQFOxCdMn7sYmyfmGisBqn77UGT4pV5bgyUrMIuVMV52pKf4rV9K+iorKbTBuYbE MjUXlAN+vF64U1GBP1waCuPER8yc2Ypr8EStqIelEvkPoL5H2m7+U+7P9mc6fwUxbL7r LYwprJIG9zlWAWWqe6b5u8dgREwLm8XpuioLsS3gECy5QLktaUpEWxtgSfnJqyWk5Kxc 8duXkPzwbzJTXA7ttiYj8L/bh9/uPeIhaQmQLDTiO9fLVdN/J5eM0i8+CxAtl8+CTKr1 T9nQ== X-Gm-Message-State: AO0yUKXYQRZcx+BIBamkKqRbxnpDKbqaSL44MircOKfpwxkU108KCsd6 xuRziUZwHxIPRhi/O4h1mpKFN81OfVJedLRdTeaqbOw0NNY= X-Google-Smtp-Source: AK7set/5rhPpOqceVXXfcbRHKVolvfkJAaQx4GOCjYWG54EQV2o30uhrZy4G1bVgSSSd6Bi/L11/C6DN3p+PW3FV2cs= X-Received: by 2002:ac2:53ad:0:b0:4e8:3eda:4305 with SMTP id j13-20020ac253ad000000b004e83eda4305mr2766206lfh.11.1678943416679; Wed, 15 Mar 2023 22:10:16 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Bharath Rupireddy Date: Thu, 16 Mar 2023 10:40:05 +0530 Message-ID: Subject: Re: Add macros for ReorderBufferTXN toptxn To: Peter Smith Cc: Masahiko Sawada , Amit Kapila , vignesh C , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 16, 2023 at 7:20=E2=80=AFAM Peter Smith = wrote: > > PSA v4 which addresses both of your review comments. Looks like a reasonable change to me. A nitpick: how about using rbtxn_get_toptxn instead of an explicit variable toptxn for single use? 1. Change ReorderBufferTXN *toptxn =3D rbtxn_get_toptxn(txn); TestDecodingTxnData *txndata =3D toptxn->output_plugin_private; To TestDecodingTxnData *txndata =3D rbtxn_get_toptxn(txn)->output_plugin_p= rivate; 2. Change ReorderBufferTXN *toptxn =3D rbtxn_get_toptxn(txn); toptxn->txn_flags |=3D RBTXN_HAS_STREAMABLE_CHANGE; To rbtxn_get_toptxn(txn)->txn_flags |=3D RBTXN_HAS_STREAMABLE_CHANGE; 3. Change /* * Update the total size in top level as well. This is later used to * compute the decoding stats. */ toptxn =3D rbtxn_get_toptxn(txn); if (addition) { txn->size +=3D sz; rb->size +=3D sz; /* Update the total size in the top transaction. */ toptxn->total_size +=3D sz; } else { Assert((rb->size >=3D sz) && (txn->size >=3D sz)); txn->size -=3D sz; rb->size -=3D sz; /* Update the total size in the top transaction. */ toptxn->total_size -=3D sz; } To /* * Update the total size in top level as well. This is later used to * compute the decoding stats. */ if (addition) { txn->size +=3D sz; rb->size +=3D sz; rbtxn_get_toptxn(txn)->total_size +=3D sz; } else { Assert((rb->size >=3D sz) && (txn->size >=3D sz)); txn->size -=3D sz; rb->size -=3D sz; rbtxn_get_toptxn(txn)->total_size -=3D sz; } -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com