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 1pD3Xu-00037G-2v for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jan 2023 13:11:06 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pD3Xs-0007MC-BO for pgsql-hackers@arkaria.postgresql.org; Wed, 04 Jan 2023 13:11:04 +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 1pD3Xs-0007M3-04 for pgsql-hackers@lists.postgresql.org; Wed, 04 Jan 2023 13:11:04 +0000 Received: from mail-oa1-x34.google.com ([2001:4860:4864:20::34]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pD3Xh-0007xL-QE for pgsql-hackers@lists.postgresql.org; Wed, 04 Jan 2023 13:11:02 +0000 Received: by mail-oa1-x34.google.com with SMTP id 586e51a60fabf-150debe2b7cso4055145fac.0 for ; Wed, 04 Jan 2023 05:10:53 -0800 (PST) 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=DHUCt4vaiCgvbfW5ci5Cbfv1hWg5nxJn4sZDGqUSMdc=; b=V5XcXwbvCs6+PLY7L4FXs5wlemctWo/K5ek24mPFNV5/4TizJ0AC10hOpJYaNjgQBV dtcIK/xqVwhBeHM+ZiYNHkMuvJbwc5BZ1cxYG85E7AxoZ+OJgVXV70/R1AXEJL9ysZzR nyjDfbyCrCnyGTN7yPrgbdSnv7qzOasec65Js7Op5Biq4fxX0A1iWE/7MXJHyIMf1K+t v1IVw2HBQaYRsF48gZsto5FdhDI9P/0pQCSHPwdZqlvT86QRH/3dNwYktnkpedsg5A4+ 3ZST115HHfpvrXcdTAAF8+NwNNBzZHWCailjTNAHxRIdrCVaO/skMGFLopPcoSwmASaV gjJw== 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=DHUCt4vaiCgvbfW5ci5Cbfv1hWg5nxJn4sZDGqUSMdc=; b=JaQaVaGLLpjQYdNo8tLzk7kcbI+0PbHyVzYCHNar5/PcT244LsRXqp6Fx+tbowarc1 EQCB3rFgHKlfMJ8Hc3JzgCkrigvgEYQJZfYru2FXteh8U5d5WOqTJMzkZty8DrCgUp0t 8bNUnTLJusS63w1JdPpCYhfYi7hruMjxf+r83uT3RhJtc8BqU9XWnjtF5MIzZk/XrVgc KTyBSIy/CbX6RRqN9HRSjEvxftiSfWZ/w/49rkSvjFgxazjfgllYnsHqEOjkGmf3sPng DoFSZGMrlOaosv2CLz1X8UhBqXZp3dulcdT31+rYzgRSsJx67d1MZRbSzMPhECQt50uo Jt8w== X-Gm-Message-State: AFqh2kr+ghi+PdTOCg+dPgTPRlMmZ1iAwtsXWCO5k3SxeCWnh8hhgwZk 3fKH7J0EW7nSTkjnaCAtqJlIB+G6zOT08edSWfA= X-Google-Smtp-Source: AMrXdXtyWpE9v4V+d0QbhuIKKArKGsEpeoJbEyNx8DBGRg6I60OdlZKNtZN760j0dilEZaflc/PoeYtjRqMbnts5Egw= X-Received: by 2002:a05:6871:8a3:b0:144:c77a:1467 with SMTP id r35-20020a05687108a300b00144c77a1467mr3460501oaq.272.1672837853011; Wed, 04 Jan 2023 05:10:53 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Wed, 4 Jan 2023 18:40:41 +0530 Message-ID: Subject: Re: Perform streaming logical transactions by background workers and parallel apply To: Dilip Kumar Cc: "houzj.fnst@fujitsu.com" , Masahiko Sawada , "wangw.fnst@fujitsu.com" , Peter Smith , "shiy.fnst@fujitsu.com" , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Jan 4, 2023 at 4:52 PM Dilip Kumar wrote: > > 2. > + * Since the database structure (schema of subscription tables, constraints, > + * etc.) of the publisher and subscriber could be different, applying > + * transactions in parallel mode on the subscriber side can cause some > + * deadlocks that do not occur on the publisher side. > > I think this paragraph needs to be rephrased a bit. It is saying that > some deadlock can occur on subscribers which did not occur on the > publisher. I think what it should be conveying is that the deadlock > can occur due to concurrently applying the conflicting/dependent > transactions which are not conflicting/dependent on the publisher due > to . Because if we create the same schema on the > publisher it might not have ended up in a deadlock instead it would > have been executed in sequence (due to lock waiting). So the main > point we are conveying is that the transaction which was independent > of each other on the publisher could be dependent on the subscriber > and they can end up in deadlock due to parallel apply. > How about changing it to: "We have a risk of deadlock due to parallelly applying the transactions that were independent on the publisher side but became dependent on the subscriber side due to the different database structures (like schema of subscription tables, constraints, etc.) on each side. -- With Regards, Amit Kapila.