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 1naA5O-0008ML-S9 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 05:44:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1naA5N-0008W5-F6 for pgsql-hackers@arkaria.postgresql.org; Fri, 01 Apr 2022 05:44:37 +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 1naA5N-0008Vv-5x for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 05:44:37 +0000 Received: from mail-pf1-x42b.google.com ([2607:f8b0:4864:20::42b]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1naA5K-0003Hr-TP for pgsql-hackers@lists.postgresql.org; Fri, 01 Apr 2022 05:44:36 +0000 Received: by mail-pf1-x42b.google.com with SMTP id b15so1662029pfm.5 for ; Thu, 31 Mar 2022 22:44:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:message-id:to:cc:subject:from:in-reply-to:references :user-agent:mime-version:content-transfer-encoding; bh=V/l/J6G/PCv9WQ4X+2/Y5EvD+2zwGwH+1lfeZGGzkRo=; b=bt+Dbj53z4CJM0B8Ljwr3+3z4rHPsw0LRY5RD4fohkONx5YFXHTcPgQwvm6K/IT12x xOlETOX55nnH3DNZI8FrpcnUiCqr5Ge9xGf0IX8lT9hBaCCh+nqeAyU1D7GeLRz0m4oY wG4/dazq5uLtHkInUpoAsnm+GF3ZqA9187hgrk9uELGRWMi/3641LU6P/zA3jysQtV/6 50RS54+m23Nk4EfrqMjfFmCs+nuyfdJr4Dy3HKyGCIntWyhb4AWbdX2lWOk/0VPfSPtl 4aPlMZ3mrScGNDb1Ict3rGkQ9HuraoogJNGgFG+8ljYI+2jVri9WVAaWgvU3+QdM+ghj 79Gg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:to:cc:subject:from:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=V/l/J6G/PCv9WQ4X+2/Y5EvD+2zwGwH+1lfeZGGzkRo=; b=2UmOMIteMx5ZQyGU1pkBkpFwzBhyp+gjBBBsp8Pmadl0v4MnovkMVz6aPslP8u9Wm+ o9LwqcSlVZpjIb8h30i6W0sB5MKXfheVbKQK2v5Xhkt2D0j7Z6Hn3Qsr4mqxn9zMonKJ 2yhgQKJ8fzULbkjSd8Gn7m3j2+2vvX7HKWkMJ0LTmbXxbeYb4Cy5MpHi5F4PJzO/xCHL hLiQotEu7ysBnLeCZBLYmAoqzfFSsEaN9YYDa9o9cfVH2T3jdPqulJC9Y22BhwqgTIYa Z5hh2x4FppmJIvTf5eMvMyIn+BAEVcTIpd14FURJILPKkcAESjTAWULms7B17CKeJGtA fLqQ== X-Gm-Message-State: AOAM531tjn5zlWyGyO2ie5DpklcvKy4b20Hrnx/3ZdTR8zTQ1mj0olZy cOKBtIh36Ca7dpwMVoUcYN8= X-Google-Smtp-Source: ABdhPJwnlt/s6jrDGUMBY/6bycq2FxFLds26LJdMvVMMY/3MnQBFQkpQ1EKrU759rc4q9WrE13nO3w== X-Received: by 2002:a05:6a00:1312:b0:4e1:58c4:ddfd with SMTP id j18-20020a056a00131200b004e158c4ddfdmr9126126pfu.65.1648791873816; Thu, 31 Mar 2022 22:44:33 -0700 (PDT) Received: from localhost (KD036014041111.ppp-bb.dion.ne.jp. [36.14.41.111]) by smtp.gmail.com with ESMTPSA id k10-20020a056a00168a00b004f7e2a550ccsm1389932pfc.78.2022.03.31.22.44.31 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 31 Mar 2022 22:44:32 -0700 (PDT) Date: Fri, 01 Apr 2022 14:44:30 +0900 (JST) Message-Id: <20220401.144430.1701887207072649814.horikyota.ntt@gmail.com> To: y.sokolov@postgrespro.ru Cc: dilipbalaut@gmail.com, 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: <755c7bb23ad97a4a5319ebd13cdf8afccf5f05ed.camel@postgrespro.ru> References: <20220131.152011.148738317202375552.horikyota.ntt@gmail.com> <755c7bb23ad97a4a5319ebd13cdf8afccf5f05ed.camel@postgrespro.ru> User-Agent: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=koi8-r Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk At Sun, 13 Feb 2022 17:35:38 +0300, Yura Sokolov wrote in = > =F7 =F0=CE, 07/02/2022 =D7 13:52 +0530, Dilip Kumar =D0=C9=DB=C5=D4: > > Right. I think the patch looks fine to me. > > = > = > Good day. > = > I've looked to the patch. Personally I'd prefer dynamically resize > xip array. But I think there is issue with upgrade if replica source > is upgraded before destination, right? I don't think it is relevant. I think we don't convey snapshot via streaming replication. But I think that expanding xip or subxip is wrong, since it is tied with ProcArray structure. (Even though we abuse the arrays in some situations, like this). > Concerning patch, I think more comments should be written about new > usage case for `takenDuringRecovery`. May be this field should be ren= amed > at all? I don't feel the need to rename it so much. It just signals that "this snapshot is in the form for recovery". The more significant reason is that I don't come up better name:p And the comment is slightly modified and gets a pointer to detailed comment. + * Although this snapshot is not acutally taken during recovery, all = XIDs + * are stored in subxip. See GetSnapshotData for the details of that = form + * of snapshot. > And there are checks for `takenDuringRecovery` in `heapgetpage` and > `heapam_scan_sample_next_tuple`. Are this checks affected by the chan= ge? > Neither the preceding discussion nor commit message answer me. The snapshot works correctly, but for the heapgetpage case, it foces all_visible to be false. That unnecessarily prevents visibility check from skipping. An annoying thing in SnapBuildInitialSnapshot is that we don't know the number of xids before looping over the xid range, and we don't want to bother sorting top-level xids and subxids unless we have to do so. Is it better that we hassle in SnapBuildInitialSnapshot to create a !takenDuringRecovery snapshot? regards. -- = Kyotaro Horiguchi NTT Open Source Software Center