Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfYUM-0000ef-8z for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Mar 2023 03:53:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pfYUK-0005AQ-OC for pgsql-hackers@arkaria.postgresql.org; Fri, 24 Mar 2023 03:53:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pfYUK-0005AH-E3 for pgsql-hackers@lists.postgresql.org; Fri, 24 Mar 2023 03:53:12 +0000 Received: from mail-vs1-f45.google.com ([209.85.217.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pfYUH-0004IY-3L for pgsql-hackers@lists.postgresql.org; Fri, 24 Mar 2023 03:53:11 +0000 Received: by mail-vs1-f45.google.com with SMTP id cu36so554646vsb.7 for ; Thu, 23 Mar 2023 20:53:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679629987; h=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=oqprBbnQEM+0w5f9UKG6Qo/00IFopp8zBv7A8xo10po=; b=4XzvnSS3VszLtCzpCEJpP2/QOYB8aPzh3m1Ue7mS7dOblxy+zaUVR6qdcAQMYdXlnq +u/7q9hlpZIR00Q0LP9vAuvP5eu86/F0T4EJFsUqccH6xPjjxnnEWQPh6+bZYLH97MJc vsXVEmpXZ5OP6pdnvQd6s+pqFU/fQOpHot2BabI2hd1rK/8LzDxAFEGfj1S3qr3SLunO /qP6d7RYBrtWvVFA+t/WnOhzwxX+rJbVDg73FhjxOsshZxuaPwqf55SCXO6tO+6cX8I/ YMTkNfHlLZEFzWu5LApbUF9lxhBqj6WyPasQokAKK7ohru1U0+PnxO5jzC2MQlj0s5qk RP3w== X-Gm-Message-State: AAQBX9dI+HKaXQrezsJ7g30BmajPy8R4KsdU33LZCG66WLg6M8Dd+3iF L0/rtFnMwO46OS56e7yEM3lWLsLCP2Xm2tbi8bU= X-Google-Smtp-Source: AKy350Y83JT775DKN9ncNO0Gd1f+A6o8RcR2q7oorIwKTepRac6xhogtOwhmHz/vK+UorHwGqGEVwFYQaoEnby2C7Is= X-Received: by 2002:a67:c215:0:b0:425:eb13:b07d with SMTP id i21-20020a67c215000000b00425eb13b07dmr572097vsj.4.1679629987343; Thu, 23 Mar 2023 20:53:07 -0700 (PDT) MIME-Version: 1.0 References: <20230323100726.vzrgvpjt3il7uemq@alvherre.pgsql> In-Reply-To: From: Greg Stark Date: Thu, 23 Mar 2023 23:52:31 -0400 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: Euler Taveira , Alvaro Herrera , Amit Kapila , Kyotaro Horiguchi , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 23 Mar 2023 at 23:30, Bharath Rupireddy wrote: > > > + ereport(log_replication_commands ? LOG : DEBUG3, > > + (errmsg("acquired physical replication slot \"%s\"", > > + slotname))); So this is just a bit of bike-shedding but I don't feel like these log messages really meet the standard we set for our logging. Like what did the acquiring? What does "acquired" actually mean for a replication slot? Is there not any meta information about the acquisition that can give more context to the reader to make this message more meaningful? I would expect a log message like this to say, I dunno, something like "physical replication slot \"%s\" acquired by streaming TCP connection to 192.168.0.1:999 at LSN ... with xxxMB of logs to read" I even would be wondering if the other end shouldn't also be logging a corresponding log and we shouldn't be going out of our way to ensure there's enough information to match them up and presenting them in a way that makes that easy. -- greg