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 1oipEA-0003AX-GO for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Oct 2022 03:49:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oipE9-0006Nm-Au for pgsql-hackers@arkaria.postgresql.org; Thu, 13 Oct 2022 03:49:45 +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 1oipE9-0006Nd-1p for pgsql-hackers@lists.postgresql.org; Thu, 13 Oct 2022 03:49:45 +0000 Received: from mail-yw1-x112d.google.com ([2607:f8b0:4864:20::112d]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oipE2-0001D2-LX for pgsql-hackers@lists.postgresql.org; Thu, 13 Oct 2022 03:49:44 +0000 Received: by mail-yw1-x112d.google.com with SMTP id 00721157ae682-35ad0584879so6707667b3.7 for ; Wed, 12 Oct 2022 20:49:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=IktIvXlCzLJ7CYCk1tE5UXYCm/x1iB8Emtv3k0wVA+8=; b=S9pBeOeFhgxL8kKk5eMVTIXQGPpwws7IPByi4VC/PLUX59Lrr0WAuWlg0KYfgQm52k 1292qJ045RQ5D3cEFfipb3bGqN8fhkamOjQSwtc6XHuYqasOU3Qm5K38BZdAL33aRghP uXjunyoh2Fa9bjJfF1DGVlkDTza015g+ABBqD34oq26ITurrABJHCSpnZS0HeQHeGhh0 4LXvE38vGkhcSy540f/LB9b5M+BiTFKQ0+ikr6RyyVL0MPAWD55kJlT8Ru728l0SWbQg L4Upv7wC8CKrX7YKfphcFyj0JrrTUXHt6KrnBAPN16SfGAIOH/8OCvqq5sOX5Hy/g6aa YBPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=IktIvXlCzLJ7CYCk1tE5UXYCm/x1iB8Emtv3k0wVA+8=; b=2UMty6nr0KTaKGmofhvY8UOXLz+/ROemy9sKAXLTaE3x2mNCkOMTZ4jGEm670wlV8s 8RyvW9rog9Yayd0mBjTHB6FRj69iIWVHJtx4aMCfGPBYGo1fTZsuTdkscVGB3VosW0HY UF61fmOK8cIXV9Gb8KrNTRftBZxFxrym4e8ht7GsYxikykMpbTPMM9xKSY5QtCoXXNjl JJIVpjJO/7ZrgABFsFO4krM+16U+LD+ZLlIbNpwlq+QVoHtypL91uzpxGK1iEYwZjasK +Tjy2pkYTM+GMxujWxo/fn/k4TTp5tn0xedxAbGCif9BAL0aQD5kG3iZAHj3ZS7I+Lyq ko6A== X-Gm-Message-State: ACrzQf00XXxV3hWSygmgXyEhYjCzvjbqS2T+uPU8yueUyD/DYjjqOv// VO4FLw2BwtcKheEmyICptgYH7d3HldbhqXY8oGY= X-Google-Smtp-Source: AMsMyM5djJiBsfZ+9haog1J8UQsgNTXCMQjOQ4YiJQqO7wLM0IJ+Bu00e8pbEkjx3ZvcK9pcyHD6lX/zfZBgI1Gzg80= X-Received: by 2002:a81:bd3:0:b0:358:ecd5:291d with SMTP id 202-20020a810bd3000000b00358ecd5291dmr29170757ywl.305.1665632977675; Wed, 12 Oct 2022 20:49:37 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Thu, 13 Oct 2022 09:19:26 +0530 Message-ID: Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: "kuroda.hayato@fujitsu.com" Cc: "houzj.fnst@fujitsu.com" , Dilip Kumar , Masahiko Sawada , "shiy.fnst@fujitsu.com" , Peter Smith , PostgreSQL Hackers , "wangw.fnst@fujitsu.com" Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Oct 6, 2022 at 6:09 PM kuroda.hayato@fujitsu.com wrote: > > ~~~ > 10. worker.c - apply_handle_stream_start > > ``` > + * > + * XXX We can avoid sending pair of the START/STOP messages to the parallel > + * worker because unlike apply worker it will process only one > + * transaction-at-a-time. However, it is not clear whether that is worth the > + * effort because it is sent after logical_decoding_work_mem changes. > ``` > > I can understand that START message is not needed, but is STOP really removable? If leader does not send STOP to its child, does it lose a chance to change the worker-state to IDLE_IN_TRANSACTION? > I think if we want we can set that state before we went to sleep in parallel apply worker. So, I guess ideally we don't need both of these messages but for now, it is fine as mentioned in the comments. -- With Regards, Amit Kapila.