Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1jAcyU-0004AD-O0 for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Mar 2020 17:10:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jAcyR-0006P7-MA for pgsql-hackers@arkaria.postgresql.org; Sat, 07 Mar 2020 17:10:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jAcyR-0006P0-7R for pgsql-hackers@lists.postgresql.org; Sat, 07 Mar 2020 17:10:51 +0000 Received: from mail-yw1-xc43.google.com ([2607:f8b0:4864:20::c43]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jAcyH-0007zs-Cg for pgsql-hackers@postgresql.org; Sat, 07 Mar 2020 17:10:47 +0000 Received: by mail-yw1-xc43.google.com with SMTP id d206so5532146ywa.12 for ; Sat, 07 Mar 2020 09:10:40 -0800 (PST) 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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xa9Ik5X7SoWOm4gzyBgSL1xcLJGOF/aKJo1sxlDAVHQ=; b=TuL8AIPMG0eA1p6jxk+KhrpLEPzZ2ok6/hzYYBuCmYZJE/nlE8Nlruy/eKNn3+NAGo BC13i+/x9WG2G5lrtOleBdtoO77w/jEzVh05kuUupIxDzeZdxYpPoGa7CgdE3MbIu83s xfbDtRzWRZbzblexlpgXWC7JR5Lc6Vx4yuYu1uIHWES5S9x65IEqiEZW5ZHqqwP1EThI NVtT84+k3v0UvnuRWkqjmVI/5H+koDV7GWpOZAFYcGDhH5RP1kf7062EWcySfBMlhjRs 3Nblm57aQGNiFf7K0K+0yLnpmMXV8Tda2ElqhBnKhKamh7hj5nBQBGI4ktXDv2vJEc/b HRrA== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xa9Ik5X7SoWOm4gzyBgSL1xcLJGOF/aKJo1sxlDAVHQ=; b=dcDo2P36+BU012Lkvm3sH3hzkAdssJ95IyTyAkqFpqFYxBzHwih46MvI0HD4LAd9vZ DlYtOrXtCPWu6GsZjFWrzfj9MZZd4LkMb/2KNND+4yT0Qjk8Q0CHsuYKBRifDnIesBQ5 Ot/ZIvSpouV8voJFMcQQfYXQwQpvAgYxUMzUYegV3kEwfv8NFTi8QnaLUMLw/Ek3AW3F tiK3iNXZr0Ai4SkzpryuyorgLdWkJr4C6RDD+FMrp06L23lxL1AteDyXDlTcb6XiK75O LCMcdTgp1mEyXLVgiXXUORr8UUkzWED73U8clS446jl3j5sZrdp24esx/6+PypD+TLk8 S1VA== X-Gm-Message-State: ANhLgQ0vprqJu7M0lN3yC+8/9cu2cVd7N9nwAGBttGAjyosB8qVeX1J9 6L6zakuEuMi3ZEEvbv3Bt/B49Q== X-Google-Smtp-Source: ADFU+vvzfLV5JK0iNc+p0VkV4TCI4dtPQH0FvECqWLfqob26/V6Ce/ZMMuWj10i/JKwe9YAm+90KZg== X-Received: by 2002:a81:7741:: with SMTP id s62mr9827125ywc.327.1583601039417; Sat, 07 Mar 2020 09:10:39 -0800 (PST) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id f205sm13192465ywa.2.2020.03.07.09.10.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 07 Mar 2020 09:10:38 -0800 (PST) Received: by pryzbyj (Postfix, from userid 1000) id BB2CA800C28; Sat, 7 Mar 2020 11:10:36 -0600 (CST) Date: Sat, 7 Mar 2020 11:10:36 -0600 From: Justin Pryzby To: Fabien COELHO Cc: Alvaro Herrera , David Steele , pgsql-hackers@postgresql.org, "Bossart, Nathan" , Thomas Munro Subject: Re: pg_ls_tmpdir to show directories and shared filesets Message-ID: <20200307171036.GA1357@telsasoft.com> References: <20200303200117.GI684@telsasoft.com> <20200303202313.GA28076@alvherre.pgsql> <20200305161838.GJ684@telsasoft.com> <20200306233507.GN684@telsasoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Sat, Mar 07, 2020 at 03:14:37PM +0100, Fabien COELHO wrote: > Some feedback about the v7 patch set. Thanks for looking again > About v7.1, seems ok. > > About v7.2 & v7.3 seems ok, altought the two could be merged. These are separate since I proprose that one should be backpatched to v12 and the other to v10. > About v7.4: ... > It seems that lists are used as FIFO structures by appending, fetching & > deleting last, all of which are O(n). ISTM it would be better to use the > head of the list by inserting, getting and deleting first, which are O(1). I think you're referring to linked lists, but pglists are now arrays, for which that's backwards. See 1cff1b95a and d97b714a2. For example, list_delete_last says: * This is the opposite of list_delete_first(), but is noticeably cheaper * with a long list, since no data need be moved. > ISTM that several instances of: "pg_ls_dir_files(..., true, false);" should > be "pg_ls_dir_files(..., true, DIR_HIDE);". Oops, that affects an intermediate commit and maybe due to merge conflict. Thanks. > About v7.5 looks like a doc update which should be merged with v7.4. No, v7.5 updates pg_proc.dat and changes the return type of two functions. It's a short commit since all the infrastructure is implemented to make the functions do whatever we want. But it's deliberately separate since I'm proposing a breaking change, and one that hasn't been discussed until now. > Alas, ISTM that there are no tests on any of these functions:-( Yeah. Everything that includes any output is going to include timestamps; those could be filtered out. waldir is going to have random filenames, and a differing number of rows. But we should exercize pg_ls_dir_files at least once.. My previous version had a bug with ignore_missing with pg_ls_tmpdir, which would've been caught by a test like: SELECT FROM pg_ls_tmpdir() WHERE name='Does not exist'; -- Never true, so the function runs to completion but returns zero rows. The 0006 commit changes that for logdir, too. Without 0006, that will ERROR if the dir doesn't exist (which I think would be the default during regression tests). It'd be nice to run pg_ls_tmpdir before the tmpdir exists, and again afterwards. But I'm having trouble finding a single place to put it. The closest I can find is dbsize.sql. Any ideas ? -- Justin