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 1lvCEA-00076K-Jh for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jun 2021 05:12: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 1lvCE9-00013V-In for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Jun 2021 05:12:05 +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 1lvCE9-00013I-B5 for pgsql-hackers@lists.postgresql.org; Mon, 21 Jun 2021 05:12:05 +0000 Received: from mail-qk1-x732.google.com ([2607:f8b0:4864:20::732]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lvCE7-0005Ww-2V for pgsql-hackers@lists.postgresql.org; Mon, 21 Jun 2021 05:12:04 +0000 Received: by mail-qk1-x732.google.com with SMTP id q64so20972264qke.7 for ; Sun, 20 Jun 2021 22:12:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=19711Omvlpt+xctGre9Dfb/0Vp0CAlpPM2H5ctMmG3Q=; b=nDAb3TdQ3eywn+2QMEeAEDfProADzouIfuhGUfsWkwD8Jrcl+zRr4KODhpHvoobXZx ga+fWfT3cRvmm57WxlTojgHkmmjD10DaxgCQ+JByUpdpoVpFTNRU7oXDv/JhIIicsbjg AZpRoSkkREZEAuythRP3LW/JN4GvwNQCmEpUNvRc4cVxuOU3o76mfUBoPB0u74UumZeW nW9GNefo26rFFX5cHi5dbHq4JGVAw2t3YTiimQHjy0/ipyxKQPEiDdlw7ASw42Su3YQi PLtJ/lSdKjZPLA5NJSO7clP5wDNo03+o6nahmThW313TeyyfQM7S0qgxUkZ0VWtNVuH7 v+BA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=19711Omvlpt+xctGre9Dfb/0Vp0CAlpPM2H5ctMmG3Q=; b=o9AF18LCjEqrA/vmeoLDo2NvqKYMvnojwmExptfKoMXP1lYp/JhzC5HQscozVtp1yN 37XmtORlGSmYEhe3zr675QitrixWEe2DZDclkujKh0b2YdvtsBmiapy7hSV6LQYVSoR3 DN7ig5ApeDP1DciPZGgeCDF7+AYF7M20yNEq7stykmOv3VOlG1oyb3J/BAQ5jyVYX+XV Pxcz4s6Ge6hnQEWdIRJLigHLdh64XA7s7bIt6SfwL65M7pR9xn1bf6AGN8oV+DhYbTJD aUbtLVczqdeY1gCFVwBwZIeZYSSMy9bY8uQhwSafvEJ9zYKGFtEFlzJAmh+II+lxmT75 9YxQ== X-Gm-Message-State: AOAM5330dSHe4PTsIdwILv7DdpB9SIe1S7ZRvPWm6Aw+fn2sZn5S3JJd zGzfa7AIavHi/9k+Ogiqzvw7Qvazj8hB4Zi6Lzs= X-Google-Smtp-Source: ABdhPJx1VXqP/CWF+Rc9EN5im44L7WBnIiavfDMxXc4sTgI//axPYZBVU2BkAzMaDbgI8HNLbRsChM5jXaKK3jUIOUA= X-Received: by 2002:a25:bb91:: with SMTP id y17mr30960849ybg.177.1624252322139; Sun, 20 Jun 2021 22:12:02 -0700 (PDT) MIME-Version: 1.0 References: <14738A39-8000-463E-A0BA-6729930A32DA@enterprisedb.com> In-Reply-To: <14738A39-8000-463E-A0BA-6729930A32DA@enterprisedb.com> From: Amit Kapila Date: Mon, 21 Jun 2021 10:41:51 +0530 Message-ID: Subject: Re: Optionally automatically disable logical replication subscriptions on error To: Mark Dilger Cc: Masahiko Sawada , "Smith, Peter" , 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 Mon, Jun 21, 2021 at 10:24 AM Mark Dilger wrote: > > > On Jun 20, 2021, at 8:09 PM, Amit Kapila wrote: > > > > Because currently, we don't proceed after an error unless it is > > resolved. Why do you think there could be multiple such transactions? > > Just as one example, if the subscriber has a unique index that the publisher lacks, any number of transactions could add non-unique data that then fails to apply on the subscriber. > Then also it will fail on the first such conflict, so even without your patch, the apply worker corresponding to the subscription won't be able to proceed after the first error, it won't lead to multiple failing xids. However, I see a different case where there could be multiple failing xids and that can happen during initial table sync where multiple workers failed due to some error. I am not sure your patch would be able to capture all such failed transactions because you are recording this information in pg_subscription and not in pg_subscription_rel. -- With Regards, Amit Kapila.