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 1kMlir-0005B2-2D for pgsql-admin@arkaria.postgresql.org; Mon, 28 Sep 2020 05:29:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1kMlip-0003VZ-OY for pgsql-admin@arkaria.postgresql.org; Mon, 28 Sep 2020 05:29:11 +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 1kMlip-0003VQ-Cd for pgsql-admin@lists.postgresql.org; Mon, 28 Sep 2020 05:29:11 +0000 Received: from mail-pj1-x1044.google.com ([2607:f8b0:4864:20::1044]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1kMlif-0001Y6-R3 for pgsql-admin@lists.postgresql.org; Mon, 28 Sep 2020 05:29:08 +0000 Received: by mail-pj1-x1044.google.com with SMTP id kk9so2874626pjb.2 for ; Sun, 27 Sep 2020 22:29:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=0Jej2jLUMYxsWdykal8cWKS5jj7JYTuIWsM+UU3mBKU=; b=q18S3aGP6nMUw5XEkol4qtWn9BhHLNyWk9UKBZSDLB1EOQJ2BcldPL/y1rcWgZdpIL rdwuliZ21inPYuLWOxMFovcyLnicCN3EJqE3HZQo/PNzFvQontXpdDOHW+572wCypJ+c aD9x0ND1FiNJH13CbZgfDGpYawrlNgxmaknWo5BHA5YRqEsP6Xca7WQICnBntjSzdpFp Aw/o/wPpALxVaJEM0XibajmVFD8pKLAxoyRk2WVKGOaQ+AxD9IXWrLAxkHAgRE2mS5Qc YxD6GVDRxTTk6FEQTZMqI93MoOV6rNmFuVP8sAG6H/WbZiQBtha7ypxG5SJXjApc860J R7bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=0Jej2jLUMYxsWdykal8cWKS5jj7JYTuIWsM+UU3mBKU=; b=WILiGMjuHhwmUp5yY9Kxf96ao7uVkparEXw3TVKF7Gkzh4bbUy1oPCAGEG5ptqab3G HRf7bFRPxgSh8Ub+RrRzwhd3t+WkUrAVlrYmQTs7Hebma9HyDaPw3rBOB0AT03q38xHS NEUa0V5EgytAUu3TC+RXsjJCl45NMasluGUSDx0Zdn0F3A2oma8IHUCNSVCzC2RvkFci w9WqmQi5xdB6b/K4B1N9evas/5CZNXU2/91KFC9l4A4yswJQoONwkwLfFjBmYFyirBsu JJs5lUG7kPwCMl6gdqSagLvzPSh1fVDkKau2GzV8nrjze1soBOWdmcmVXExI9usiuxYV gl6Q== X-Gm-Message-State: AOAM532IHO7hobwg07g/hsKwk4Kr9leaYTcaDwIgFsTJCJ6wXZmaNnyf iwWdeFUW75VKV5r4g1TGodNF1JdGAaEPX0kWfcyG06zwhYWMXkrvhXUxhj6SDposhtA+vu6nqDV K28uo+je4ubaxOEf6UDRC//B8OHekZLogbZ62JhCKJNJMCQo4EBRMXCOuR/Fj+n4DUg0tNDWgNU A8jLPAzPwuGBrI/c9g6GMXhyM= X-Google-Smtp-Source: ABdhPJy+yB+xkDKaC5nigcQ6fERoJiLOAwNafmk4gt0BJTAVICJp6A5RXzaEAu7DUL+LCre368sF5A== X-Received: by 2002:a17:90b:289:: with SMTP id az9mr8096864pjb.31.1601270939227; Sun, 27 Sep 2020 22:28:59 -0700 (PDT) Received: from osaka.octopusnet (p13186-ipngn8201marunouchi.tokyo.ocn.ne.jp. [153.214.140.186]) by smtp.gmail.com with ESMTPSA id h9sm8529812pgk.52.2020.09.27.22.28.57 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 27 Sep 2020 22:28:58 -0700 (PDT) Subject: Re: many "cp: cannot stat xxx No such file or directory" logs in warm standby To: Hong Yao , pgsql-admin@lists.postgresql.org References: From: Ian Barwick Message-ID: Date: Mon, 28 Sep 2020 14:28:55 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020/09/28 14:12, Hong Yao wrote: > Hi all > > I am setting up a standby server for my PG-12.4 primary server, following the doc https://www.postgresql.org/docs/12/warm-standby.html#STANDBY-SERVER-SETUP (26.2.4. Setting Up a Standby Server" > The OSes are CentOS-7.8 > > The steps on the standby: (...) > * set restore command in postgresql.conf > o /    restore_command = 'cp /var/pg_wal_archive/%f %p' / > o /    archive_cleanup_command = 'pg_archivecleanup /var/pg_wal_archive %r'/ (...) > But in the standalone logs, i see following errors keep repeating: > > /cp: cannot stat ‘/var/pg_wal_archive/000000020000000000000014’: No such file or directory/ > /cp: cannot stat ‘/var/pg_wal_archive/00000003.history’: No such file or directory/ This is expected, as PostgreSQL is speculatively looking for files which may have arrived since the last check. Per the documentation [1]: "The command will be asked for file names that are not present in the archive" [1] https://www.postgresql.org/docs/current//runtime-config-wal.html#GUC-RESTORE-COMMAND Regards Ian Barwick -- Ian Barwick https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services