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 1qy1Vz-005DV0-AI for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2023 03:03:31 +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 1qy1Vw-005c8T-0N for pgsql-hackers@arkaria.postgresql.org; Wed, 01 Nov 2023 03:03:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qy1Vv-005c8L-N9 for pgsql-hackers@lists.postgresql.org; Wed, 01 Nov 2023 03:03:27 +0000 Received: from mail-oa1-x29.google.com ([2001:4860:4864:20::29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qy1Vp-0045VG-0h for pgsql-hackers@lists.postgresql.org; Wed, 01 Nov 2023 03:03:27 +0000 Received: by mail-oa1-x29.google.com with SMTP id 586e51a60fabf-1ea05b3f228so3999218fac.1 for ; Tue, 31 Oct 2023 20:03:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1698807798; x=1699412598; 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=UPUcKLD4uK5r4dd46Ior1beYWmprwQ2AwRTQtZUrC7c=; b=IZnhtYDVkYRMsgdFspLJkWRH82IXcpf+1PtU+YsHdYLX24iZKNqpspKIdns8B+6cJJ BUj3au0mygE703Y89pANfUVLPVpxb1ESnd+Zjv3LMQdqQN6VIKpjSwRbuEe3EeKzQUDy tu6UdmAz6+sh3Rb1Zj3Xit/5922+SJpK3z7p/cF5Jmd1+cBoiy3aF9yxCwXPaGA4nQsZ 7iIn17T2lx8Vfaat+bAuhaWmXnJ7ZClovn6jAYuybGBtUbpwqfYgEpMXM7FWto1BE69i 9vD6d+voq7sDYY8PVHfEGTudGLbvrFDntT3ASlcLyA2rYaz69IjJobJQDGadIiQLiUB7 8BJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1698807798; x=1699412598; 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=UPUcKLD4uK5r4dd46Ior1beYWmprwQ2AwRTQtZUrC7c=; b=KMP+f6PU/yvDthKxe9e00ekkX2CBNQsl7YMqZhZ7RBZIuMtVk7alV9Vo88sLJVsGW6 hUH6J9PoYeXYVlWLkip/kgRTOQIL2dC+dqR9orh0TDIsEyPm7FdTbB7piUTgwHfXVe+i +CHqIUCO62+5DOyIrm5Vg2r5yMA0vZjfKRXiDSHXYAtC/2brIsGA/Y0DSxvHQtnTGzVa +wyPT/Kz0t6T+4Hwp4AiK+RRqiOl/IHlCydd/KH6oMbPNFk2kT4gt5DuWeBx+BqL8WuD Nx43OK7a9prnCIoxaR3mi/dAg7owYPQGnxQElLC71Rkb1/mYX+Re6Eiug5xS53K66fMp zVSQ== X-Gm-Message-State: AOJu0YwBOwN9xbb2jZe27MgtkPrwopXRoKcuKGxZDpLpDRtshYDNhzxf FfR35WUUv+kZDcwbHMkX2A9ClINL4BH2U7pOweg= X-Google-Smtp-Source: AGHT+IGcYR0hdDSRxZbHtLRshSXk8GnX406kszRtVq42SP6tu80raT5O/HFmmG/jQy43wjFReyUMbw0C0y4FGzBzdu0= X-Received: by 2002:a05:6870:9a24:b0:1e9:d25d:3cb0 with SMTP id fo36-20020a0568709a2400b001e9d25d3cb0mr17951911oab.21.1698807798610; Tue, 31 Oct 2023 20:03:18 -0700 (PDT) MIME-Version: 1.0 References: <20230324093547.amsbfoql2kmbqco2@alvherre.pgsql> In-Reply-To: From: Amit Kapila Date: Wed, 1 Nov 2023 08:33:07 +0530 Message-ID: Subject: Re: add log messages when replication slots become active and inactive (was Re: Is it worth adding ReplicationSlot active_pid to ReplicationSlotPersistentData?) To: Bharath Rupireddy Cc: Alvaro Herrera , Greg Stark , Euler Taveira , Kyotaro Horiguchi , 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 Mon, Mar 27, 2023 at 11:08=E2=80=AFAM Bharath Rupireddy wrote: > > The v9 patch was failing because I was using MyReplicationSlot after > it got reset by slot release, attached v10 patch fixes it. > + * + * Note: use LogReplicationSlotAcquire() if needed, to log a message after + * acquiring the replication slot. */ void ReplicationSlotAcquire(const char *name, bool nowait) @@ -542,6 +554,9 @@ retry: When does it need to be logged? For example, recently, we added one more slot acquisition/release call in binary_upgrade_logical_slot_has_caught_up(); it is not clear from the comments whether we need to LOG it or not. I guess at some place like atop LogReplicationSlotAcquire() we should document in a bit more specific way as to when is this expected to be called. --=20 With Regards, Amit Kapila.