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 1oWiAW-00008F-CV for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Sep 2022 17:51:56 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oWiAV-0003Ef-A4 for pgsql-hackers@arkaria.postgresql.org; Fri, 09 Sep 2022 17:51:55 +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 1oWiAU-0003Ck-S2 for pgsql-hackers@lists.postgresql.org; Fri, 09 Sep 2022 17:51:55 +0000 Received: from mail-qt1-x830.google.com ([2607:f8b0:4864:20::830]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oWiAS-0002Vd-MT for pgsql-hackers@postgresql.org; Fri, 09 Sep 2022 17:51:54 +0000 Received: by mail-qt1-x830.google.com with SMTP id h21so1884079qta.3 for ; Fri, 09 Sep 2022 10:51:50 -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=XV/eTEdUBJwX/inyaIoYQ7u6Pm2bgvEv2o+6cU/6DWk=; b=4SFpwJkjQ2T3oRgbCPybcvhYVIjncJ/GDnjkfwijETRwdWOhkvy5dkxcxJwTbTQ+9v DB9q3G+35XEZpVmrALyDSRqw+VfGjf2Zkk7IfpFMQU3Yl2IRhBWhMsPtqHZBwI8WzRVh 5DoieEqqymrQSkVRzP3oCAzZ4RRDT44lXv6FQ7iPHsFL2PiJNFyBQLOMqNSLdVmmbvKG tDu6i2Xt/ixOZ+BpS0R9qW37xMccB+4aqAxDeksGQBjAXJIF0yd459zyYtGqCZOCrsJQ txcdyrt4gWScbjiNH6aunW1gHAMcdrGM4t7ZUwzpoEmgO1ZTyyVl6b7WQRnXY/T+obTd uxmQ== 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=XV/eTEdUBJwX/inyaIoYQ7u6Pm2bgvEv2o+6cU/6DWk=; b=pQZ2eovZhFgam0ohV5/xoyPoS27RGxG0avzitOPpmBQBhn0cIY3xtc36yGnUyDNHQL PaP7FsQd7f+JGrLP0QUBP5NwrMyzfk97a2vdqJIyOkv+Fve4SCdCFLTjwzbnZ/dn8adT YvQh/tyqAcIh4KSLkMeLEVI9DqdgioI4TmnwNRO1HzQn90NIwXepKQjBV5OzcQXteTBJ N00KxzZD9+HtgUGJjaPLrejth7Kk3rch90XVaeGP0RqaHZPxHD5ur1/wzumpP6uy5/Ka JyXZWQub1BNfdta+jw+yfmy2sBBjI7Y7u80dudfMlbAfWTFUxarCxvsLqRC3Mk7qOSKQ CF1g== X-Gm-Message-State: ACgBeo2JSPAnk59JhswFiNYCvSzlAs38pxVDa9flajr7XCaWYmzbLAOG 9AwpomN5AuJpPG8a+M2hTSGKWETBUZkLHQ== X-Google-Smtp-Source: AA6agR4vxmNxu806c1myss0m8/RUE6QUC6KItzshLiw/D053L87Kv41gqdUVW+C+mRgsfUAFo+Oniw== X-Received: by 2002:ac8:5fcb:0:b0:344:5d06:8d83 with SMTP id k11-20020ac85fcb000000b003445d068d83mr13695719qta.300.1662745909297; Fri, 09 Sep 2022 10:51:49 -0700 (PDT) Received: from ahch-to ([201.183.1.162]) by smtp.gmail.com with ESMTPSA id j20-20020a05620a289400b006bbf85cad0fsm1022834qkp.20.2022.09.09.10.51.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Sep 2022 10:51:48 -0700 (PDT) Date: Fri, 9 Sep 2022 12:51:45 -0500 From: Jaime Casanova To: Andres Freund Cc: pgsql-hackers@postgresql.org Subject: Re: START_REPLICATION SLOT causing a crash in an assert build Message-ID: References: <20220907193908.prfnxnt6diao2fli@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220907193908.prfnxnt6diao2fli@awork3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 07, 2022 at 12:39:08PM -0700, Andres Freund wrote: > Hi, > > On 2022-09-06 18:40:49 -0500, Jaime Casanova wrote: > > I'm not sure what is causing this, but I have seen this twice. The > > second time without activity after changing the set of tables in a > > PUBLICATION. > > Can you describe the steps to reproduce? > I'm still trying to determine that > Which git commit does this happen on? > 6e55ea79faa56db85a2b6c5bf94cee8acf8bfdb8 (Stamp 15beta4) > > > gdb says that debug_query_string contains: > > > > """ > > START_REPLICATION SLOT "sub_pgbench" LOGICAL 0/0 (proto_version '3', publication_names '"pub_pgbench"')START_REPLICATION SLOT "sub_pgbench" LOGICAL 0/0 (proto_version '3', publication_names '"pub_pgbench"') > > """ > > > > attached the backtrace. > > > > > #2 0x00005559bfd4f0ed in ExceptionalCondition ( > > conditionName=0x5559bff30e20 "namestrcmp(&statent->slotname, NameStr(slot->data.name)) == 0", errorType=0x5559bff30e0d "FailedAssertion", fileName=0x5559bff30dbb "pgstat_replslot.c", > > lineNumber=89) at assert.c:69 > > what are statent->slotname and slot->data.name? > slot->data.name seems to be the replication_slot record, and statent->slotname comes from the in shared memory stats for that slot. And the assert happens when &statent->slotname.data comes empty, which is not frequent but it happens from time to time btw, while I'm looking at this I found that we can drop a publication while there are active subscriptions pointing to it, is that something we should allow? anyway, that is not the cause of this because the replication slot actually exists. -- Jaime Casanova Director de Servicios Profesionales SystemGuards - Consultores de PostgreSQL