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 1jurfR-0008Ce-Hq for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jul 2020 06:10:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jurfQ-0004d8-Gu for pgsql-hackers@arkaria.postgresql.org; Mon, 13 Jul 2020 06:10:20 +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 1jurfQ-0004d1-6j for pgsql-hackers@lists.postgresql.org; Mon, 13 Jul 2020 06:10:20 +0000 Received: from mail-il1-x12e.google.com ([2607:f8b0:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jurfJ-00084u-On for pgsql-hackers@lists.postgresql.org; Mon, 13 Jul 2020 06:10:19 +0000 Received: by mail-il1-x12e.google.com with SMTP id p15so2561588ilh.13 for ; Sun, 12 Jul 2020 23:10:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :user-agent; bh=qOrQWF7VFysX2p61QgDZlgaGuj0r8Fy/h81LunLv7IE=; b=iL/ca/QKMfLsZwxib/Q2VAXY7dx0q3Wv3a4zmRHdFpcTmSxi+7ZSFQvOeOlf5sDXC/ Ks7l6+2sTF3cWsscHZqHeJdJA/AmqTfPKTj3CIiJPLoHZnMw3Ji64aYe29Jm55j9BNjc BT3u9W+x78J4g4Vp81FbKEgHRQKKBqv10G74rKbbAubTxUHN7SMeR15W8R1YaMmQFIlI ViZ1wwLrMBu3stz9Br/NdMxuRC6DdVZdo6lFanYeti7D6BhDQpdhdyDA4Y4uOY59bd01 zY7wZtI+ML546+QOp1TYsJhT4IL/EwxrsxdibwMhN4Jlrris5jcfg85loXvzrPe6qLog R9Nw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:user-agent; bh=qOrQWF7VFysX2p61QgDZlgaGuj0r8Fy/h81LunLv7IE=; b=XIP5rBlnZAxrSFxgQ2n4qvlE+e6YvfeYbh8avost86glVNFZRA1Xu56Ejt6CKapLd8 jaXVdTvpAxmLO0Hfh4Sj/PP45n6m3rAkPtHbZO0d+jZZc+1w0y96n/nOCC9L+lcOC7N+ gaqGOJBDJhmD/JlJ3T2JrhVb/6/LO7hlc/sBNR6owUl28HvlEs0t1XiClvlAimxBEl7Z Y6inIC3hQGgRFr5+fM+QpD3QOTg05bVcKVAhKrzFhNU9rVwMDH+NxpMBtPabcdWPnKbr LudvfsBwAeqRFzn/GRLgXOlSwQt5Up93W6JNdnLVpjjrHCdEKd1d8pVLG+ELNNAuo9yd 8IbA== X-Gm-Message-State: AOAM531YpDENqJoqlgIL62uigASPatsLYyAgSV7xPZqdhyQjYwNxcV5U BjQI30usbJk9ozFzSLirjQzqxg== X-Google-Smtp-Source: ABdhPJyx3PpYLAP9VOS6MJOfCYkaHFtEzfimTzGkYEhrSdWTfnuW8j+xVgZRHH9CoNjoRD+pCGj7wA== X-Received: by 2002:a05:6e02:cd3:: with SMTP id c19mr64925360ilj.16.1594620612768; Sun, 12 Jul 2020 23:10:12 -0700 (PDT) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id y2sm7263031iox.22.2020.07.12.23.10.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 12 Jul 2020 23:10:11 -0700 (PDT) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 167AA800BBA; Mon, 13 Jul 2020 01:10:11 -0500 (CDT) Date: Mon, 13 Jul 2020 01:10:10 -0500 From: Justin Pryzby To: pgsql-hackers@lists.postgresql.org Cc: Heikki Linnakangas , Michael Paquier , Fujii Masao Subject: Re: Don't choke on files that are removed while pg_rewind runs. Message-ID: <20200713061010.GC23581@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk commit b36805f3c54fe0e50e58bb9e6dad66daca46fbf6 Author: Heikki Linnakangas Date: Sun Jun 28 21:35:51 2015 +0300 ... |@@ -175,22 +175,31 @@ libpqProcessFileList(void) | pg_fatal("unexpected result set while fetching file list\n"); | | /* Read result to local variables */ | for (i = 0; i < PQntuples(res); i++) | { | char *path = PQgetvalue(res, i, 0); | int filesize = atoi(PQgetvalue(res, i, 1)); | bool isdir = (strcmp(PQgetvalue(res, i, 2), "t") == 0); | char *link_target = PQgetvalue(res, i, 3); | file_type_t type; | |+ if (PQgetisnull(res, 0, 1)) ... |+ continue; Every other access to "res" in this loop is to res(i), which I believe is what was intended here, too. Currently, it will dumbly loop but skip *every* row if the 2nd column (1: size) of the first row (0) is null. -- Justin