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 1ks72B-00008F-KU for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Dec 2020 16:30:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ks72A-0006e0-Jw for pgsql-hackers@arkaria.postgresql.org; Wed, 23 Dec 2020 16:30:42 +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 1ks72A-0006dt-93 for pgsql-hackers@lists.postgresql.org; Wed, 23 Dec 2020 16:30:42 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ks723-0008AP-Ng for pgsql-hackers@lists.postgresql.org; Wed, 23 Dec 2020 16:30:41 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id 27A7B21C7D84; Wed, 23 Dec 2020 19:30:35 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1608741035; bh=V1Dl3VItdzsRF1E231z9yH/c5nehfUtpS+1tL1+IQIE=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=aFrUYBW6jmvr5KtxpRmCO7XHZ6qYeAsWnE+cdgRaRyiwpo4Trme2f78gNbTEOwE2N IYP4LPwOo/YDrOMibokI7ZcaIaZtWcHA/1IGlVrleCQI1xZCYOXC0aDd+TQV3Istcb yqtfgGy+2yM9QfIxyKBGud7LuVoHPy+7B+Omy6qA= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 Dec 2020 19:30:35 +0300 From: Alexey Kondratov To: Michael Paquier Cc: Justin Pryzby , Alvaro Herrera , Peter Eisentraut , Masahiko Sawada , Steve Singer , pgsql-hackers@lists.postgresql.org, Robert Haas , Alexander Korotkov , Masahiko Sawada , Jose Luis Tallon Subject: Re: Allow CLUSTER, VACUUM FULL and REINDEX to change tablespace on the fly In-Reply-To: References: <7ec67c56-2377-cd05-51a0-691104404abe@enterprisedb.com> <20201216004517.GA18498@alvherre.pgsql> <20201222083204.GL30237@telsasoft.com> <20201222211537.GO30237@telsasoft.com> User-Agent: Roundcube Webmail/1.4.0 Message-ID: <2f88c198e80e7352eb03de44017b929a@postgrespro.ru> X-Sender: a.kondratov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-12-23 10:38, Michael Paquier wrote: > On Tue, Dec 22, 2020 at 03:15:37PM -0600, Justin Pryzby wrote: >> Now, I really think utility.c ought to pass in a pointer to a local >> ReindexOptions variable to avoid all the memory context, which is >> unnecessary >> and prone to error. > > Yeah, it sounds right to me to just bite the bullet and do this > refactoring, limiting the manipulations of the options as much as > possible across contexts. So +1 from me to merge 0001 and 0002 > together. > > I have adjusted a couple of comments and simplified a bit more the > code in utility.c. I think that this is commitable, but let's wait > more than a couple of days for Alvaro and Peter first. This is a > period of vacations for a lot of people, and there is no point to > apply something that would need more work at the end. Using hexas for > the flags with bitmasks is the right conclusion IMO, but we are not > alone. > After eyeballing the patch I can add that we should alter this comment: int options; /* bitmask of VacuumOption */ as you are going to replace VacuumOption with VACOPT_* defs. So this should say: /* bitmask of VACOPT_* */ Also I have found naming to be a bit inconsistent: * we have ReindexOptions, but VacuumParams * and ReindexOptions->flags, but VacuumParams->options And the last one, you have used bits32 for Cluster/ReindexOptions, but left VacuumParams->options as int. Maybe we should also change it to bits32 for consistency? Regards -- Alexey Kondratov Postgres Professional https://www.postgrespro.com Russian Postgres Company