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 1oXzJm-0000S1-Nu for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 06:22:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oXzJl-0001tu-AS for pgsql-hackers@arkaria.postgresql.org; Tue, 13 Sep 2022 06:22:45 +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 1oXzJk-0001tl-Uy for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 06:22:45 +0000 Received: from mail-pl1-x62c.google.com ([2607:f8b0:4864:20::62c]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1oXzJi-0008UR-N7 for pgsql-hackers@lists.postgresql.org; Tue, 13 Sep 2022 06:22:44 +0000 Received: by mail-pl1-x62c.google.com with SMTP id u22so10773895plq.12 for ; Mon, 12 Sep 2022 23:22:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:from:to:cc:subject :date; bh=gE68moz93rlKlXJLmhKGbGoFiXSfFM0OxmyRN+cWDLM=; b=bZTCF+JbpF6qRELiJ79DlPM98WiqRXM4rwARiq5wn4K4ltGyZniMeS9GKCEbL16ai5 DvrXIFnA/YcOY7HWl8/jwvreEVV1DZUz/QyXQFNWqbQjirLQyl2BSaEBe1bBPavQpqvV GSth1+CZnwOVykVGsnLBzYsMQbWUErpGyjeuDH+IT3hB0eB/LB4Ku7EYDopU760yJaXh fJvz4FGUyqkRtb8S6uEkqnJ/8s3ZS3qL8KsK0E/4uiOKaIuFOzFMc06+0onfmkq6401j 3oYKsE+zvrQs3hs7d6SyONLdFEuNqBSnyx4PkJY6vkZdsh+yywcK3hfId2u8d81/o5lc E0Yg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:references :in-reply-to:from:subject:cc:to:message-id:date:x-gm-message-state :from:to:cc:subject:date; bh=gE68moz93rlKlXJLmhKGbGoFiXSfFM0OxmyRN+cWDLM=; b=etVlTwnz3jQ3ynDjhtwRlgsjPXqtkMJ4s59nlR7whnxUxFN8d1O3fAvG54iaJpV7Yt xzEyPtDYJhcmAkxESyR5oPQ4ZRJp7Da+awpF+AVrCGK1SI+c+aUrnTlouIX62/yxuSyz tDrxcglcYosKx34yIMm8+TcWouvYtD8xph/ZZLf1aTIG2nDX9jUzKW9FGyxFwGPx5bnn GrNtHfdu4sNkxj/RWyqae4VUwUZpCUfq35BgUu5TYUcuntAd8lnRIplPNDMTPa5pHOk5 MkAQIXTPVaS1qcZTc1lPjstHKA3e88yz3haenptS7UvHmmpxupAx3B2Whl31z9xndXQr fRRw== X-Gm-Message-State: ACgBeo02fJr1lOb/vo1SiRwSsL8oTLb+73nCFoVA98tTB5QGHVc0araO sDLYW9R1wYbEhRcLlFYw8QE= X-Google-Smtp-Source: AA6agR7YfEdSGF8Cm2s81QwyKuVvspocmMDdFVgQmMiOI6ssdsltZ3o9ikhEQAL4qGDkDwGfzv1yXA== X-Received: by 2002:a17:90b:4c8e:b0:202:be8c:518e with SMTP id my14-20020a17090b4c8e00b00202be8c518emr2366631pjb.26.1663050160698; Mon, 12 Sep 2022 23:22:40 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id h184-20020a6283c1000000b0053e80515df8sm6738603pfe.202.2022.09.12.23.22.38 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 12 Sep 2022 23:22:40 -0700 (PDT) Date: Tue, 13 Sep 2022 15:22:37 +0900 (JST) Message-Id: <20220913.152237.338218493796303493.horikyota.ntt@gmail.com> To: dilipbalaut@gmail.com Cc: andres@anarazel.de, jchampion@timescale.com, y.sokolov@postgrespro.ru, rjuju123@gmail.com, pgsql-hackers@lists.postgresql.org Subject: Re: Error "initial slot snapshot too large" in create replication slot From: Kyotaro Horiguchi In-Reply-To: References: <20220719.115506.1518451006264600540.horikyota.ntt@gmail.com> <20220912215156.zi52zu6n7od3k3v3@awork3.anarazel.de> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Thanks for raizing this up, Robert and the comment, Andres. At Tue, 13 Sep 2022 07:00:42 +0530, Dilip Kumar wrote in > On Tue, Sep 13, 2022 at 3:22 AM Andres Freund wrote: > > > > > It's not obvious to me that it's the right design (or even correct) to ask > > reorderbuffer about an xid being a subxid. Maybe I'm missing something, but > > why would reorderbuffer even be guaranteed to know about all these subxids? > > Yeah, you are right, the reorderbuffer will only know about the > transaction for which changes got added to the reorder buffer. So > this seems not to be the right design idea. That function is called after the SnapBuild reaches SNAPBUILD_CONSISTENT state ,or SnapBuildInitialSnapshot() rejects other than that state. That is, IIUC the top-sub relationship of all the currently running transactions is fully known to reorder buffer. We need a comment about that. > > I wonder if a better fix here wouldn't be to allow importing a snapshot with a > > larger ->xid array. Yes, we can't do that in CurrentSnapshotData, but IIRC we > > need to be in a transactional snapshot anyway, which is copied anyway? > > Yeah when I first found this issue, I thought that should be the > solution. But later it went in a different direction. I think that that is the best solution if rbtxn_is_known_subxzact() is known to be unreliable at the time. regards. -- Kyotaro Horiguchi NTT Open Source Software Center