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 1oYIkq-0002sx-MZ for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Sep 2022 03:08:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oYIko-0003W1-Hb for pgsql-hackers@arkaria.postgresql.org; Wed, 14 Sep 2022 03:07:58 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oYIko-0003Ut-5A for pgsql-hackers@lists.postgresql.org; Wed, 14 Sep 2022 03:07:58 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oYIkl-00022D-C9 for pgsql-hackers@postgresql.org; Wed, 14 Sep 2022 03:07:56 +0000 Received: by mail-qt1-x829.google.com with SMTP id s18so7275727qtx.6 for ; Tue, 13 Sep 2022 20:07:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=systemguards-com-ec.20210112.gappssmtp.com; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date; bh=Ov5ewGkrBvUt5KA1U7MjqE/lVmmrAreXhW4fg52pek0=; b=Dcj7jVALJVg/F/7rLke3kxevwWjxEvi36RD4NCNvgDPN7SXbgnEqoEqT6aAKvyVm5B Dqdq2tlLx/2MWR0Zp34f9mRy2qnij8yZz1xL1QSvDmNDfiGIE5YRmNnO2q12euKyYmpG 9Xa2h82h+YbFTPUnmID8a66fSIWDMBdhOQrc0Cop7sYuZnZ9Q/SBRP/c7QQmh6Wt/K0X Tl0S6BccPp8Sa4xq85uWWgssscFlU7A0kcgBEfF4a/JSQh0fPbzkwlKLmtLzbvQx3gEH iEmuNrp7oUVMV0odIdn2rB6LpYCB5QqMvGamnpuEEKnYDSF+h8O8YkpSgbvZNMiFISgv 8bHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date; bh=Ov5ewGkrBvUt5KA1U7MjqE/lVmmrAreXhW4fg52pek0=; b=esNt8Ale+AJ/y+Gxm5sQLr8p3/MOun0TjRtDAS6fowkoRX05hJLfjKE+wB9ZQTC7sk aatUstOb1xqEBNRhckpy4ckzOqoZEG1yJpULEz1upgSppXGo6O/C94zbB2280vC/ixey kH/9cb4Gucqn2XPreLB2hpKq/g3VxLcaFaHcJUkwFpR9g5kIEQE9E5+fy7OdwDDHQlfP UaJ9airi17mYpWUNc0DQeXGCKYR7t4Flzo4IlGQH0VOhDyoRPN/gdOGAczpFMJvuawEb fttAxoXmgoMtwcBpOjUeTlswvXIqGopyVFmI57cEemZVJ0FvVUTTDaQcQQcRrdRFkxK/ uVlg== X-Gm-Message-State: ACgBeo3CK81qx9WK7oG+iPvgbdhLjIsm7LbTZrhcYaAh9FQMWr6xZONr mXRar9CmGObJ08gkdLWch6SDqQ== X-Google-Smtp-Source: AA6agR4EiJiqNxCgkOdJCRRD5js/y+VIKVj52F8CviFedk18+3VdoYMTSk6BemFKS9djN8zGxCiPXg== X-Received: by 2002:a05:622a:5a0b:b0:35b:b8fc:874f with SMTP id fy11-20020a05622a5a0b00b0035bb8fc874fmr9105349qtb.267.1663124874259; Tue, 13 Sep 2022 20:07:54 -0700 (PDT) Received: from ahch-to ([201.183.1.162]) by smtp.gmail.com with ESMTPSA id s14-20020ac85ece000000b00339b8a5639csm713964qtx.95.2022.09.13.20.07.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Sep 2022 20:07:53 -0700 (PDT) Date: Tue, 13 Sep 2022 22:07:50 -0500 From: Jaime Casanova To: Kyotaro Horiguchi Cc: andres@anarazel.de, pgsql-hackers@postgresql.org Subject: Re: START_REPLICATION SLOT causing a crash in an assert build Message-ID: References: <20220907193908.prfnxnt6diao2fli@awork3.anarazel.de> <20220913.184845.2130916662920954058.horikyota.ntt@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220913.184845.2130916662920954058.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Sep 13, 2022 at 06:48:45PM +0900, Kyotaro Horiguchi wrote: > Nice finding. > > At Tue, 13 Sep 2022 00:39:45 -0500, Jaime Casanova wrote in > > and the problem seems to be that after zero'ing the stats that includes > > the name of the replication slot, this simple patch fixes it... not sure > > if it's the right fix though... > > That doesn't work. since what that function clears is not the name in > the slot struct but that in stats entry. > you're right... the curious thing is that I tested it and it worked, but now it doesn't... maybe it was too late for me... > The cause is what pg_stat_reset_replslot wants to do does not match > what pgstat feature thinks as reset. > [...] > > Another measure would be to add the region to wipe-out on reset to > PgStat_KindInfo, but it seems too much.. (attached) > This patch solves the problem, i didn't like the other solution because as you say it partly nullify the protection of the assertion. -- Jaime Casanova Director de Servicios Profesionales SystemGuards - Consultores de PostgreSQL