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 1lvWAe-00078l-Rj for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jun 2021 02:29:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lvWAc-0001QT-Hv for pgsql-hackers@arkaria.postgresql.org; Tue, 22 Jun 2021 02:29:46 +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 1lvWAc-0001QK-6R for pgsql-hackers@lists.postgresql.org; Tue, 22 Jun 2021 02:29:46 +0000 Received: from mail-pg1-x52a.google.com ([2607:f8b0:4864:20::52a]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lvWAX-0007LV-Uz for pgsql-hackers@lists.postgresql.org; Tue, 22 Jun 2021 02:29:44 +0000 Received: by mail-pg1-x52a.google.com with SMTP id t9so15845718pgn.4 for ; Mon, 21 Jun 2021 19:29:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb-com.20150623.gappssmtp.com; s=20150623; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vPgnT3hY6X4TzBbvcc2HKcDbO9ZjzAzmTnj9Cfdjn+U=; b=HJK5RHzQWYMjs8azUIayvxMlW3ffAUnBOGvNCeUWsUb3tHDUIfEVgprcHMY7RMWqtH yMfG3aUhPV9WgMBEjRQ6fZbfNqaHxd2B/ok3H40qrVapVjYEZXYqebemlMBnnR68fU/5 K8rRhxNaDuihWiST9LCg8x+Exikrjxt7tJBepH7xZ6pnMnt8JWR2Fj29DBNfqo6RwJsr e6ya3CA/NzrR3xa4KPUbtKB53jR//vohDnIqjqztS9YXzaty2/hfGPy7TOISphyUgTKe JDekVnkoaOffYXxcnrLDD4J7ZQvqM5VOqfQXZnuwIIcKuM0o7mR9znHEfzk01bJ1VAYj J1mA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=vPgnT3hY6X4TzBbvcc2HKcDbO9ZjzAzmTnj9Cfdjn+U=; b=Rd8G/R8hbaDB3/WcEkJE+MVcrgib011Mgct8ZKLXayBwrhBWbNi7vZ/tWc/GwKZ+2X RS4MIGRsplE6GlotQsUxjqZR9zRQAW2H2/xeX4vBsxkFEM1NuXnTg5FsVBBsLsO6drNS 8qGeU5Jo9wn2R87ZR+m0DsWP2KqkCtWf8vzMrAkNVBFydaEYz+khiiuRp7LVgnNVWTTp lydU+3JNJMPxS6p4BSV3wStLpj4/2rFfLsF6RnBE5BjAeAgx4HW5EhTt8XJwIKEZPO7K uyIYInAb3POSUD7juPCTOZScxVQjIO8aLJ0TfOuJcqc0KuG8aa8WngYUlyelDBO4OGdu Dm4w== X-Gm-Message-State: AOAM531pY/LpylgpQcSTY1jH5pkg4EQLPYTuSsXkygXihcMYPFdDFkRJ T34oxUTeqIQYQ5wv7omIqRJRviS3DY+bJxyxJ2Bfo+S+OIz+SB4Q2tWEyWeIBvkUR8VfZP6+/Sg mVDWrcUF/JLGUMQBsbmnIkbg2+MwekjUj+FRdazH+ON4WJJWTdW7PQahqqypMT1d/0DmhNklB+3 uciq1C594oEJpl09wqpaEBdRrzf+PfHw+Y+fsPwZKE4RgCusKCsyHx X-Google-Smtp-Source: ABdhPJzK0+9nsZmio+t2Wj1b1kv5U8QHbfKV+h5NRgFxjcrj4LYv8yLsjkc9GNedvz5AVP59U2wFZQ== X-Received: by 2002:a63:d411:: with SMTP id a17mr1516076pgh.260.1624328979961; Mon, 21 Jun 2021 19:29:39 -0700 (PDT) Received: from ?IPv6:2600:6c50:157f:eb87:312a:3853:88ca:1561? ([2600:6c50:157f:eb87:312a:3853:88ca:1561]) by smtp.gmail.com with ESMTPSA id n5sm14362871pgf.35.2021.06.21.19.29.38 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 21 Jun 2021 19:29:39 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.6\)) Subject: Re: Optionally automatically disable logical replication subscriptions on error From: Mark Dilger In-Reply-To: Date: Mon, 21 Jun 2021 19:29:38 -0700 Cc: Amit Kapila , Masahiko Sawada , "Smith, Peter" , PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: References: <14738A39-8000-463E-A0BA-6729930A32DA@enterprisedb.com> To: Peter Smith X-Mailer: Apple Mail (2.3608.120.23.2.6) X-CLOUD-SEC-AV-Info: enterprisedb,google_mail,monitor X-CLOUD-SEC-AV-Sent: true X-Gm-Spam: 0 X-Gm-Phishy: 0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 21, 2021, at 5:57 PM, Peter Smith = wrote: >=20 > #5. Document to refer to the logs. All ERROR details are already in > the logs, and this seems to me the intuitive place to look for them. My original motivation came from writing TAP tests to check that the = permissions systems would properly deny the apply worker when running = under a non-superuser role. The idea is that the user with the = responsibility for managing subscriptions won't have enough privilege to = read the logs. Whatever information that user needs (if any) must be = someplace else. > Searching for specific errors becomes difficult programmatically (is > this really a problem other than complex TAP tests?). I believe there is a problem, because I remain skeptical that these = errors will be both existent and rare. Either you've configured your = system correctly and you get zero of these, or you've misconfigured it = and you get some non-zero number of them. I don't see any reason to = assume that number will be small. The best way to deal with that is to be able to tell the system what to = do with them, like "if the error has this error code and the error = message matches this regular expression, then do this, else do that." = That's why I think allowing triggers to be created on subscriptions = makes the most sense (though is probably the hardest system being = proposed so far.) > But here there > is no risk of missing or insufficient information captured in the log > files ("but still there will be some information related to ERROR > which we wanted the user to see unless we ask them to refer to logs > for that." [Amit-4}). Not only is there a problem if the user doesn't have permission to view = the logs, but also, if we automatically disable the subscription until = the error is manually cleared, the logs might be rotated out of = existence before the user takes any action. In that case, the logs will = be entirely missing, and not even the error message will remain. At = least with the patch I submitted, the error message will remain, though = I take Amit's point that there are deficiencies in handling parallel = tablesync workers, etc. =E2=80=94 Mark Dilger EnterpriseDB: http://www.enterprisedb.com The Enterprise PostgreSQL Company