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 1rpTH7-006u6A-JH for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 13:25:06 +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 1rpTH6-00EmWr-Hc for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 13:25:04 +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 1rpTH6-00EmUr-82 for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 13:25:04 +0000 Received: from mail-lj1-x22c.google.com ([2a00:1450:4864:20::22c]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rpTGx-006hwd-Rx for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 13:25:02 +0000 Received: by mail-lj1-x22c.google.com with SMTP id 38308e7fff4ca-2d68cf90ec4so109204301fa.1 for ; Wed, 27 Mar 2024 06:24:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711545895; x=1712150695; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=CtahVWsrsTTtmkrI799RFt3RW98LDyoIOp7k9q3OlBk=; b=SgYKAZtO2cmWu9ENNoCOzB6NQU9ZIagvi7k1BwJ7Vmiy/mNdfNhEa97zbzPR6fUD7N O1B46eZm30H0xE4WundbcBCIl/CECnFUihMW8zaO184zr8CiY9nHhTqXmnQlVASdgQUk p7Wd2ClqcWvHcavg2v7zi354mvOdq2HcbIjCzfDcu1Aelq7a4FnrfRIrvJzdSkkkHjJw TNIhV7FdE7ACccFK9+qyBGWBAZXnVoA9aNSuF5g+sa5KfnnE54GprCjY4kLbu7Kq6IGS WflzUx8DMQOkJ2kjSqfSn/8Hq6KstNUPfweNS3NpHRCrvqGvlbGAeGluSpZ3ZG8s/AsL Nj6Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711545895; x=1712150695; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=CtahVWsrsTTtmkrI799RFt3RW98LDyoIOp7k9q3OlBk=; b=tweV8bNN7wkJrclsXYaxRIbcCsmj6mtJKkrKRBpiK6vveoi8a6zQ5jjV1QI33CxEzb ci+j0upMvg7UHMigdOOIloFdoo/iBbLtB++ibH6SCy+/msryMuBNoW9kiGTeh4pQHooC ZizKcxjq+koIidOtnm+i5MutOKR1SDSr0/HEURC0yK3zmb0uam5Yoh+tsYfnejHq64Qk 2Hv60EDJI3aliUcazNyhtIELf/fZA4vKxAzK0MlwLC/1TTYc472Nft2IH4zg10rUSrSR GHsDDMOOTOsK2QcuauGzA93NcVvXO627D7V9cpGBZWiHUdItI00hqGDnUsTwl7yaOeNr BFeg== X-Forwarded-Encrypted: i=1; AJvYcCXrc1OicpdDgwMdehKSa9OgIccj0JoOUGBb2rBwonhrcCckg9JuhTXssmRg3opu9Lq7zYCseM1IkrENZCW5ttk7FfMrYmO5lnYwhn5Z5KD852FR X-Gm-Message-State: AOJu0Yze2lNBY6MGm6nj8VZM2YCKsk8HWUg8zHw3P9NmOlulG4GMArIg xJED1RsNPk8O9ijzhyqIVvxACt4S9S5FyEfT9iKl9Kq5EJsoItOK X-Google-Smtp-Source: AGHT+IHQ5e4fHV8DtF34UgRdM6ch8hi7NrV9uCFesoY5pAbPVGhBY9A/ORqb6EexNxZeXvZTI3DQwA== X-Received: by 2002:a2e:95c3:0:b0:2d4:67e3:aa47 with SMTP id y3-20020a2e95c3000000b002d467e3aa47mr3079084ljh.48.1711545895109; Wed, 27 Mar 2024 06:24:55 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id i21-20020a05600c355500b0041488691eb1sm2140270wmq.17.2024.03.27.06.24.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 06:24:54 -0700 (PDT) Date: Wed, 27 Mar 2024 13:24:52 +0000 From: Bertrand Drouvot To: Bharath Rupireddy Cc: shveta malik , Amit Kapila , Nathan Bossart , PostgreSQL Hackers Subject: Re: Introduce XID age and inactive timeout based replication slot invalidation Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Mar 27, 2024 at 05:55:05PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 27, 2024 at 3:42 PM Bertrand Drouvot > Please see the attached v28 patch. Thanks! 1 === sorry I missed it in the previous review if (!(RecoveryInProgress() && slot->data.synced)) + { now = GetCurrentTimestamp(); + update_inactive_since = true; + } + else + update_inactive_since = false; I think update_inactive_since is not needed, we could rely on (now > 0) instead. 2 === +=item $node->get_slot_inactive_since_value(self, primary, slot_name, dbname) + +Get inactive_since column value for a given replication slot validating it +against optional reference time. + +=cut + +sub get_slot_inactive_since_value +{ shouldn't be "=item $node->get_slot_inactive_since_value(self, slot_name, reference_time)" instead? Apart from the above, LGTM. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com