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 1rpVtA-0076sT-Va for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 16:12:33 +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 1rpVt9-00H5RN-JE for pgsql-hackers@arkaria.postgresql.org; Wed, 27 Mar 2024 16:12:31 +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 1rpVt9-00H5R9-6i for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 16:12:31 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rpVt5-006jNb-9W for pgsql-hackers@lists.postgresql.org; Wed, 27 Mar 2024 16:12:29 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-34100f4f9a2so4211471f8f.2 for ; Wed, 27 Mar 2024 09:12:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711555947; x=1712160747; 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=+Qs+JoXwZMTl2S3G2xGJOY6KoF0pKNkzbOaSd3Sqx9o=; b=nYpUBaRmwbFhkY7o5DJLQSTFbyPbZTmngVOopCr8o/v3Db2n8qwnNBquGBHwRmlqnN qSl2y3qWaAKWKZvax7P7lMgObjrczEzGHHFB07v8kQljkFJFkLkJVt3eOo+aNR4c8EjD shPi6zKqFaCdzhlLwWuKqBiYphnMK4ZrUb9yqCrorh/6QU339/ZUKAM5TyeSI6XwZt3c JRjVsYfImYcrGjGa6oJd9UW2bKsIhAfDUnyrq/tbYrv4OiEurK95srLTDPszdAk2+i1R Sogvig54ZzpQu2YTGLamlHCuFy23FHw+b0+z13twNnMb/SzZQVlcJfmArpXQ9M4iCH5m pk/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711555947; x=1712160747; 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=+Qs+JoXwZMTl2S3G2xGJOY6KoF0pKNkzbOaSd3Sqx9o=; b=AaUu7KqWS1NhN3y+SfC5QWo1OKHOmXDqaRMLoKjbwyYZCv9d3bsLBzYdskjvNwK80J JlxbVKFqR/mAN4/NfhN4Zgp88T9eUp9f6KCIHYfVtVz549Gup8tO3vJIaIUPEad60kQZ Pn4ybllAoldvDdrLrKkaAwp8ZVg4d5DRK+Wcjn3uQR1CLjNU1cCpVNzFJSBXlFx61lvx 2Emk5kd41U6RyMKM+Ljj6uUQaYLZ8y9kIMeddnAOowcBP2zTx1SLHyRPx8bBh+dNCYwB dx9AG00M9VnObEU6L4P2tbhLbBqO5ufK8mxv6C5y5R7pyEg/2AWqa37gmAsKyuLB8tam aVtQ== X-Forwarded-Encrypted: i=1; AJvYcCWxDmI3rcEMiK2GNYN4My4nFAxM6MZT9syqjKHsZiMpzxD0lcC2TdiEv+O2Ws69Gfci+OPKWXd2CZa+w7X82x8XABP/Ts7nRoaXNDsD8qr616BF X-Gm-Message-State: AOJu0Yz9H/b6Talrppl6iiFxELKv/rMliqwh7TuCG8/6bJnspp8AOf3n B8MYRNP5/3zJgJE+Bm0kXK762Ng/moYbUeIhKmWxeap1kXWaZyEk X-Google-Smtp-Source: AGHT+IFtToBTBxH8QRxDwa/7O4jAtorvpSpmskH0YoOv0xhJA63dG+pUQ0e+uhm9IkJYauVtfSXDxg== X-Received: by 2002:adf:ee0d:0:b0:33d:24af:9153 with SMTP id y13-20020adfee0d000000b0033d24af9153mr307746wrn.20.1711555946686; Wed, 27 Mar 2024 09:12:26 -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 h18-20020a5d4312000000b00341bdd87fcasm13055623wrq.103.2024.03.27.09.12.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 09:12:25 -0700 (PDT) Date: Wed, 27 Mar 2024 16:12:23 +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 09:00:37PM +0530, Bharath Rupireddy wrote: > On Wed, Mar 27, 2024 at 6:54 PM Bertrand Drouvot > wrote: > > > > 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. > > Thought of using it, but, at the expense of readability. I prefer to > use a variable instead. That's fine too. > However, I changed the variable to be more meaningful to is_slot_being_synced. Yeah makes sense and even easier to read. v29-0001 LGTM. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com