Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQShC-00Dz24-IY for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jul 2023 13:12:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1qQSgA-000DLc-NH for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Jul 2023 13:11:20 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qQSgA-000DLU-Dv for pgsql-hackers@lists.postgresql.org; Mon, 31 Jul 2023 13:11:19 +0000 Received: from mail-oo1-xc33.google.com ([2607:f8b0:4864:20::c33]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qQSg5-002aPz-NX for pgsql-hackers@lists.postgresql.org; Mon, 31 Jul 2023 13:11:18 +0000 Received: by mail-oo1-xc33.google.com with SMTP id 006d021491bc7-56ca1eebcd7so720116eaf.0 for ; Mon, 31 Jul 2023 06:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690809073; x=1691413873; 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=LvSuu/J/euuFwBOBVJkx3J5kbh1YY0OXXnZax6nFhxg=; b=ZJPoEvK8Pn2lcSigU0V4oilycE/uP2idWH+ma/5DgGMMJWpI2f24ckzrm1wixFxC5N JKquL6JRqn8TyD7OjmNo2GGGWWl/8gaDLM/YaN7/l8z9QZ0mj8ltD2GaNuEICbVS3zJg HUV6+zfArsmdleKMsMdzoHlnSXq+bUUlW2iTD1QVn5Tc+sHcpvi6MLR9a5jgUVQDaw7f ztzP1UrhJBKU5MSiASJPfWdv96DRUzU0PIEH92GluHs6YjDc5mWWlsfMuqEShvq4L62f SGHG5IWzBNMuav+z7iHJFT24eV9EPv9KGkRfujuj4pd/4UdR895p0TBnFTE0Uaf4r71I 3X7w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690809073; x=1691413873; 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=LvSuu/J/euuFwBOBVJkx3J5kbh1YY0OXXnZax6nFhxg=; b=cEGcO0slB8+boFmuQAFJZBbflvU6z6K+paRdyyNhecj+TEVck37h94t9L+Ix7eJrLk +VQOyQGEwJN1UaSUpjsNQrZQpFuN6vag8a/WLFL7PAzHWfh8oLWmjlmkEP8RUDcxmgQJ gBr7+5zaOt3cqMTuFFrt1LchcYYTDU9XouTYpmDsO+5fzEfdJiHsFHWdvMAdzKu9pGL3 kkW7azyY4E/eT1tY66cCaajdJygkxGTjZd/PwFQW679xX8o8RQnNe/MB8D7vN5oGr5W1 fp3aXj10/pHvyQhemh+NHgIDeIZMXUs7ela7JakKpPz6pcaYZUvZMfWRofSSbl38FmvK 3Ygg== X-Gm-Message-State: ABy/qLabPZ32z1WssHBRflTcIEveTxb93pmQoL7I+/S1ymsFfVdN8NSA FrBk5IfrRB6kAFG2v43Se/w8L0ltZzuMh4T1/n0Glzy3d7exLQ== X-Google-Smtp-Source: APBJJlG6O5thK71NQ70jnPEAp0AztdMlL0x595Pkg4IfTGoPQFS7qSCOTV5V4k5z+fUP1JrtziFXG+GppOt4XV7F/Q0= X-Received: by 2002:a4a:250d:0:b0:56c:43cd:7267 with SMTP id g13-20020a4a250d000000b0056c43cd7267mr7536308ooa.8.1690809072710; Mon, 31 Jul 2023 06:11:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Mon, 31 Jul 2023 18:41:00 +0530 Message-ID: Subject: Re: Adding a LogicalRepWorker type field To: Bharath Rupireddy Cc: Peter Smith , 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 Mon, Jul 31, 2023 at 3:25=E2=80=AFPM Bharath Rupireddy wrote: > > On Mon, Jul 31, 2023 at 7:17=E2=80=AFAM Peter Smith wrote: > > > > PROBLEM: > > > > IMO, deducing the worker's type by examining multiple different field > > values seems a dubious way to do it. This maybe was reasonable enough > > when there were only 2 types, but as more get added it becomes > > increasingly complicated. > > +1 for being more explicit in worker types. > +1. BTW, do we need the below functions (am_tablesync_worker(), am_leader_apply_worker()) after this work? static inline bool am_tablesync_worker(void) { - return OidIsValid(MyLogicalRepWorker->relid); + return isTablesyncWorker(MyLogicalRepWorker); } static inline bool am_leader_apply_worker(void) { - return (!am_tablesync_worker() && - !isParallelApplyWorker(MyLogicalRepWorker)); + return isLeaderApplyWorker(MyLogicalRepWorker); } --=20 With Regards, Amit Kapila.