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 1tH0Fq-002Ra3-3N for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 12:37:50 +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 1tH0Fn-007Q7M-H1 for pgsql-hackers@arkaria.postgresql.org; Fri, 29 Nov 2024 12:37:48 +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 1tH0Fn-007Q7E-6z for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 12:37:48 +0000 Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tH0Fm-000AGV-0L for pgsql-hackers@lists.postgresql.org; Fri, 29 Nov 2024 12:37:47 +0000 Received: by mail-lf1-x134.google.com with SMTP id 2adb3069b0e04-53df1d1b6f8so2144798e87.3 for ; Fri, 29 Nov 2024 04:37:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1732883864; x=1733488664; darn=lists.postgresql.org; 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=IxXxcw3+e3tnpU9dQw7+y6v2Z2I8JRmFDSqQKB4AtrI=; b=B5jMEJcUwWwUUw7SmmLMwEV9wROj4s99r4jzoJTVk5gjMNTw3ON9ccgPV28if9TWv1 qVOdJwJxEUlYSeXbGJWgmpyq+N2aWq1hPT6+ngHvevijwG+qiyTYgHHvhRaisWZH5u7+ JOYtzG5m8nYsXVhz+lbcKV9RCNoVO9H7QFAli19Pjio96CE1gTJ8P0r+w0KlN4t76+5u vUI6Qk/JanFrbSOuDoCOmNy5PPB4YzcH7dhYa6GVk4Z1qbDT2diUKz5T2vciazuOmNeA mByf/aBIMjoKusgoq8Ifp7Oeu/vKtcE0qZl6YinjMIGS3di+e8LkgbMBg47Ht92PSOdW lmew== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1732883864; x=1733488664; 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=IxXxcw3+e3tnpU9dQw7+y6v2Z2I8JRmFDSqQKB4AtrI=; b=ICB2+VkvhV8P29HB74pKwfvo3otcLvBVOpaM7wLaCwtVkoWEsOI31PvT3a31ANas5L HSUbjsFzu2Y8Cw1FukJqDzlwVugxG09geXm4Fv+aHRxgPkmXdM5n9Ekmsd3KK2crSdN6 guEoxkBJT3hycJ2DD9uQHhLbL4JrYiCmvY96IMVHv4YbPH+SHkUpSEkskV09U252muyc /ctryHVdZaFi3Di12R2B7zWxBlwq+eGa65xfwKDwAgJKcNB+KEbbTzWj0d1xypXxVjv/ eansR8W5uL4nr4W7hEyA5g+2XMt+CQ7WCXJxsinywTN0Up8vV+5a6pRCONqycb/Mp+7c Odnw== X-Forwarded-Encrypted: i=1; AJvYcCVJok7e1nxaJN+s0mv3AVJDOILEquMBSW7AamX/eqH6GHojs36RGgyE3UqHX4Yt1NrzudVJBsD/6oe8hE3n@lists.postgresql.org X-Gm-Message-State: AOJu0YyNpK52HHaZRCrPYke/i3WekDy8n/XgbfgaQS1zf1J5bz0ClLWe 8jmLniATXXAbCSJJvcr1wnTBGQS2k4vu+9rhFhjI9UNdQtT9HQXImvNp02nIBUgdws3u6T7By7A BMjgxFiHs9IRLrO3fUjdT4gnsbzcPchPsZg== X-Gm-Gg: ASbGncssKWWk4h99z7sfPB9x8dVtFk/KkrLk8RjS7M9QesF5LmdiBwGaDJcQoDsxUl+ 41KYzH9I8ZNwLNRSMihpRyTTlDYIXtk6/ X-Google-Smtp-Source: AGHT+IExzqDVyPzD4XfamM/R7I9G4e5CDYiw5CB0TWYlrn64XZXVin7aXyhRxyN6vihNJBHJMvDhygYZ9qvHoZnxctE= X-Received: by 2002:a05:6512:3a8e:b0:53d:a9a4:7567 with SMTP id 2adb3069b0e04-53df0111fb6mr6981330e87.48.1732883864196; Fri, 29 Nov 2024 04:37:44 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Nisha Moond Date: Fri, 29 Nov 2024 18:07:32 +0530 Message-ID: Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation To: Peter Smith Cc: vignesh C , shveta malik , Bharath Rupireddy , Amit Kapila , Ajin Cherian , Bertrand Drouvot , Masahiko Sawada , Nathan Bossart , 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 Thu, Nov 28, 2024 at 5:20=E2=80=AFAM Peter Smith = wrote: > > Hi Nisha. Here are some review comments for patch v51-0002. > > =3D=3D=3D=3D=3D=3D > src/backend/replication/slot.c > > ReplicationSlotAcquire: > > 2. > GENERAL. > > This just is a question/idea. It may not be feasible to change. It > seems like there is a lot of overlap between the error messages in > 'ReplicationSlotAcquire' which are saying "This slot has been > invalidated because...", and with the other function > 'ReportSlotInvalidation' which is kind of the same but called in > different circumstances and with slightly different message text. I > wondered if there is a way to use common code to unify these messages > instead of having a nearly duplicate set of messages for all the > invalidation causes? > The error handling could be moved to a new function; however, as you pointed out, the contexts in which these functions are called differ. IMO, a single error message may not suit both cases. For example, ReportSlotInvalidation provides additional details and a hint in its message, which isn=E2=80=99t necessary for ReplicationSlotAcquire. Thoughts? -- Thanks, Nisha