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 1lWI7q-0000Q8-HT for pgsql-general@arkaria.postgresql.org; Tue, 13 Apr 2021 12:26: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 1lWI7p-0001b3-F0 for pgsql-general@arkaria.postgresql.org; Tue, 13 Apr 2021 12:26: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 1lWI7o-0001av-GJ for pgsql-general@lists.postgresql.org; Tue, 13 Apr 2021 12:26:36 +0000 Received: from mail-ej1-x630.google.com ([2a00:1450:4864:20::630]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lWI7l-0004fa-2v for pgsql-general@postgresql.org; Tue, 13 Apr 2021 12:26:35 +0000 Received: by mail-ej1-x630.google.com with SMTP id x12so4803707ejc.1 for ; Tue, 13 Apr 2021 05:26:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec-at.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:date:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=Y+AfCVt42Dr5Ov5qOVoM5QHJVNlkRjYMDeJxHdpCA8I=; b=u5ULjhlWB4J9rvjKlPzrq700UNgcaE7AXY6xGNEw+BjoSsAfnBMp46jH5lV1Qxl3hR mqxOd0QuOWmGZVjUr/9mMxASbnZ7YXe6x6UTAaeY39idN6DiRcfXFHWBRl0TpIiP4RGm NwK9TfLOZt4zBY2rozfeFaW6Hv9Hz21cyyvxkcKPQTYI40nCe3YZm0ODW97nosNUnLth 9rORwLgeJhjtiAw4+iSfvDJ9pgKhiq9G4pd91dsgCAZ2Kr2Y75GGtxohApPhpYXoVvJ1 5UIWcZsyxUYcTwqI2xGAX68cCQEZtTswhPvG3pGKDN/fX5FKP2ESU3ueCZwYfHC/jsCt yYQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:date:in-reply-to :references:user-agent:mime-version:content-transfer-encoding; bh=Y+AfCVt42Dr5Ov5qOVoM5QHJVNlkRjYMDeJxHdpCA8I=; b=OMVk3BmUVplcJXSg8TbKH1eCsp4CD5bY+tCRz0eVqWIyA80HJShqRVWB0NqGQrjKsK UTfg6Rd2gaIUwLMr+GZ/1zCJo7VvWvXWYdgwNkVYQMV865J9NufQ/A6Jwlq4RcPjSYie mGau1s3K4g9GGOTNW6e04LNAdc/samNVl7VCAODp8FHUQpR6sd4NLwI6JMtU/Q89CB+N fkOlEbX72FECSlzSx0h2NdQHsSWlyLoFHl4uBwrHxAeZ4hrTU/j6Ea6/emYzKH0+g5cj w+xqGvKWmsQgfT87mKsCvHYfSV1U/sWlezSSFeDY0zIH8Y8z3eBsR4inGXZxqO3IEPkN GsSQ== X-Gm-Message-State: AOAM533AmwKT4KE6Zm8sx0dQJgmK0X6hAhmpUGMH3rmIJUUeCPwEIs4l jSWr92dZNFw9db/r0tzkxF3aZw== X-Google-Smtp-Source: ABdhPJx+Unon1HxhpcohuZvL62YKFCAeLDNlOZzBKaRvWv/wnn6ji2sVYOFyYfqR/s3WdDOYLLMC7A== X-Received: by 2002:a17:907:1b06:: with SMTP id mp6mr32425298ejc.292.1618316791131; Tue, 13 Apr 2021 05:26:31 -0700 (PDT) Received: from localhost.localdomain (217-149-168-23.nat.highway.telekom.at. [217.149.168.23]) by smtp.gmail.com with ESMTPSA id p9sm9170575edu.79.2021.04.13.05.26.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 13 Apr 2021 05:26:30 -0700 (PDT) Message-ID: Subject: Re: "missing chunk number 0 for toast value xxx in pg_toast_xxx" when pg_basebackup From: Laurenz Albe To: Ma Xinjian , pgsql-general@postgresql.org Date: Tue, 13 Apr 2021 14:26:29 +0200 In-Reply-To: <1618306690542-0.post@n3.nabble.com> References: <1618306690542-0.post@n3.nabble.com> Content-Type: text/plain; charset="UTF-8" User-Agent: Evolution 3.36.5 (3.36.5-2.fc32) MIME-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 2021-04-13 at 02:38 -0700, Ma Xinjian wrote: > When I use pg_basebackup to backup and restore db(Let's call it A) to a > standalone instance(Let's call it B), "missing chunk number 0 for toast > value xxx in pg_toast_xxx" errors output. > > PG version: 10.3 > pg_basebackup command: > /usr/pgsql-10/bin/pg_basebackup -h p-rdb-c01 -D /var/lib/pgsql/10/data > -Xs -P -n --waldir=/tmp/pg_wal > I have mounted a disk to /tmp/pg_wal before, then I will mount the disk > to /var/lib/pgsql/10/data/pg_wal, so as to ensure completeness of wal > records during backup. > > Since I don't want B to be a standy server, I just want it to be a > standalone server. > I removed recovery.conf, then simply start postgresql-10.service. It turned > out that postgresql-10.service > can be started successfully. But when I use this postgresql(reindex, vacumm > and so on), "missing chunk number 0 for toast value xxx in pg_toast_xxx" > errors output. > > When pg_basebackup, it will store wal under pg_wal, can't postgresql work > with wal records locally? > I think primary_conninfo in recovery.conf is just used to get newer wal > records from A. Right? > > I have also tested: > If I start postgresql-10.service with recovery.conf firstly, then split it > from postgresql cluster, everything works fine. > > Above test seems proved that it is wal records's problem. I am really > confused. Your mail got me confused... Why do you write the WAL to /tmp/pg_wal, only to later mount that at the default location? I see nothing wrong with what you are doing, but I may have got lost in your complicated procedure. You don't happen to remove "backup_label", do you? Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com