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 1rp2l4-004lGS-DZ for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2024 09:06:14 +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 1rp2l3-00D0nV-3P for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Mar 2024 09:06:13 +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 1rp2jX-00CxJs-EC for pgsql-hackers@lists.postgresql.org; Tue, 26 Mar 2024 09:04:39 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rp2jU-006VMp-09; Tue, 26 Mar 2024 09:04:38 +0000 Received: by mail-wm1-x331.google.com with SMTP id 5b1f17b1804b1-4148c29c59aso7418965e9.2; Tue, 26 Mar 2024 02:04:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711443876; x=1712048676; darn=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=oq5PQI+r9auVfGRyLbit9/xDQaDMadjwhE13Mov4kNs=; b=aw1/qvl6KqEYJs22LuaGDPaTihZn2fhDNlLTbf0ROAOiPBa3wsMWgnCOpssVI0+9m3 bKFbhyZe0AjSc4Je89Zd261mBX8PQrU2ImL3c04PJIkIJAFaiIQPF0yHq7aGwB6ALgk6 pAHHnl0D2wYKAuZzsjhcPBBrY8ZUcrELEO87uQ+flbYTdqpdw/wn8UdBKZDlxYhzD5gj /BGp0WtjjjPL3ZzGUeDV5eCDkHmGNcM5K8KJSghuLJuy0tOQOnnh3KS3WOEY0jd6EIoa 2L6ujr643cvrUIxPJYGp41c4KJPP6Lzm4zmg6Uw0yEmhRZwaadi5csrEXMs9NNufoX25 +FHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711443876; x=1712048676; 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=oq5PQI+r9auVfGRyLbit9/xDQaDMadjwhE13Mov4kNs=; b=axeMz/1ecLG3swCKnJ+Vfjqz9pirAhjZPFCWlYjwc4algzRfbApZhaYLUmAKkZLH9c 62C+ETR4c88zlc9tBOyJMoZFjQ4eezlkSbNR1HT1E7n4gkwjZb02r+H5BFee3bGtHTbT PaDNj6UN2tvqUhOdNuqGVYFH78lj7RzjdoB9FAE/kMfIlBWn0QwS2ABsgigig7/l+Lav cNQ0LiLm8s0BzdLOGDxLdlSqErNs2v3ed7j+v3pbFGDuhAAcNL4jpHDvSN/jVYSwUYt1 rBzwdJ0MdAVLcgHl8ld5Sq9ODfM8mNKZHEEMeLLfUiW8tuMBxdYEsy05dIUcPHhpfr4P 1g0A== X-Forwarded-Encrypted: i=1; AJvYcCWcCyb53rsNK5OmzHJgMdxvTfSaVXy2A1zyFVe6nRp4s2AsqDjUlAb4YZXYDWEScL2MeuwhotCKGF2lN5KYnnc2T8DajqaNdb5phbFiJjkMgCDWgv5DG5BhdkOcAqFlnQe+Lr2Y X-Gm-Message-State: AOJu0YxergL4HLQeKxMQkDRigfqYEBFB0DfbDxpWUk2nDpZl+zvy1ZgS yQ/d9a/ohetpOW+wyzQ4gngkkiJ8VN+BEeStBAIrpVmQodKqHXAE X-Google-Smtp-Source: AGHT+IE8tMQXQjzTO+P+d5QBUJSVTAAnLP37TIAAWhpDRAyJN3GqsnPpF83UqN3lbBbQvO3QLh+d2g== X-Received: by 2002:adf:f208:0:b0:33e:c308:9e56 with SMTP id p8-20020adff208000000b0033ec3089e56mr450892wro.54.1711443875549; Tue, 26 Mar 2024 02:04:35 -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 ez19-20020a056000251300b00341c88ab493sm6696004wrb.10.2024.03.26.02.04.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 Mar 2024 02:04:35 -0700 (PDT) Date: Tue, 26 Mar 2024 09:04:33 +0000 From: Bertrand Drouvot To: Amit Kapila Cc: Alvaro Herrera , Robert Haas , shveta malik , Bharath Rupireddy , Amit Kapila , "pgsql-hackers@postgresql.org" Subject: Re: pgsql: Track last_inactive_time in pg_replication_slots. Message-ID: References: <202403260739.udlp7lxixktx@alvherre.pgsql> 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 Tue, Mar 26, 2024 at 01:45:23PM +0530, Amit Kapila wrote: > On Tue, Mar 26, 2024 at 1:09 PM Alvaro Herrera wrote: > > > > On 2024-Mar-26, Amit Kapila wrote: > > > > > We have a consensus on inactive_since, so I'll make that change. > > > > Sounds reasonable. So this is a timestamptz if the slot is inactive, > > NULL if active, right? > > > > Yes. > > > What value is it going to have for sync slots? > > > > The behavior will be the same for non-sync slots. In each sync cycle, > we acquire/release the sync slots. So at the time of release, > inactive_since will be updated. See email [1]. I don't think we should set inactive_since to the current time at each sync cycle, see [1] as to why. What do you think? [1]: https://www.postgresql.org/message-id/ZgKGIDC5lttWTdJH%40ip-10-97-1-34.eu-west-3.compute.internal Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com