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 1jMDm7-0004fz-FQ for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2020 16:42:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jMDm6-0003i1-Av for pgsql-hackers@arkaria.postgresql.org; Wed, 08 Apr 2020 16:42:02 +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 1jMDm6-0003hu-0E for pgsql-hackers@lists.postgresql.org; Wed, 08 Apr 2020 16:42:02 +0000 Received: from mail-qt1-x842.google.com ([2607:f8b0:4864:20::842]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jMDm3-0002pP-6K for pgsql-hackers@postgresql.org; Wed, 08 Apr 2020 16:42:01 +0000 Received: by mail-qt1-x842.google.com with SMTP id f20so339193qtq.6 for ; Wed, 08 Apr 2020 09:41:58 -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:references:mime-version :content-disposition:in-reply-to:user-agent; bh=yJJo9trAG4YRF4JYh5m7+wEU5+2W/TVCTIkNQFEFX7w=; b=nmm02+PxMTOV2UsV0o9QXa+RbShkZ/8f7+O+Abw0UGy8032GGIEj6Cefo7pB7s0H0R VO7njvGXXUi75vRTcyYjee9LjXtqG9Gxj0BtBBa63ERXzTojGbJSPLWPEdqMmffn/yUT Ph+zObXGlQqQogdGWN5ZsLaokWFiDKQVSLfXuh6+IwUzK4MYyHjQuLt4vCb/2G7xoRQU bQD+msdRcQ7N9Hict56x+prB/7t+VMsoGlgCUAEZLBDgZkA7QNAecjdYj2TTF3SFay7f duBF2RLl8nxoUs3ChaNDvCumG0F898puWDvKwMyeNlt5c5K/kg03FDDf6YCbLKoLJqBr U+0Q== 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=yJJo9trAG4YRF4JYh5m7+wEU5+2W/TVCTIkNQFEFX7w=; b=hAxE04kJ7hlbahYOw4ULzYGaiN1nROFzMvLCFuCpcGRRMvNe9qlBYiwW1iN5JZmWmW Gip9UZOSeBJFwpWgJa80ina/MjU+j9SP8qGAOnJB5Y2+MVmSw9WYrx1Xz4grxLImyIZP aWEQaDdi24mOVErlhnwRQblc9yAWm8J0KTbypznONg/DQ0ejh+9kPLnl0xGoKXLymnk5 kH15A42AJL1pC6jYPsOfkcub2obEK7/FPKISKQNw0arEYFzkzbKknAB+OvtCiMb9ZSKb LaLGtWV0NdMw7K1iYspEdoeZ9L2c2LJLeXr1NNZ248t1h7Bt4SEJGC4a65Zq/XVwqDHJ WTjg== X-Gm-Message-State: AGi0PubHJ3CXnevEphcQtxvgBNwPhDWHp4qN5SNbXCvTnKNJk+N2fTW3 cxebEaIDqqazBZjk5UBgFUbwfQ== X-Google-Smtp-Source: APiQypJbiQfgOa6czPf405GB/SEy5xGgC2vLSpJQxgSpeGb+jI7hIElgv+Lxtwq+X66GNvG9sRFA6g== X-Received: by 2002:ac8:3122:: with SMTP id g31mr7584976qtb.270.1586364117228; Wed, 08 Apr 2020 09:41:57 -0700 (PDT) Received: from pryzbyj (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id h46sm20125756qtc.84.2020.04.08.09.41.55 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 08 Apr 2020 09:41:56 -0700 (PDT) Received: by pryzbyj (Postfix, from userid 1000) id 6E79B800897; Wed, 8 Apr 2020 11:41:54 -0500 (CDT) Date: Wed, 8 Apr 2020 11:41:54 -0500 From: Justin Pryzby To: Robert Haas Cc: Mahendra Singh Thalor , tushar , pgsql-hackers@postgresql.org Subject: Re: Vacuum o/p with (full 1, parallel 0) option throwing an error Message-ID: <20200408164154.GD2228@telsasoft.com> References: <58c8d171-e665-6fa3-a9d3-d9423b694dae@enterprisedb.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="Jl+DbTnyraiZ/loT" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --Jl+DbTnyraiZ/loT Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Apr 08, 2020 at 11:57:08AM -0400, Robert Haas wrote: > On Wed, Apr 8, 2020 at 10:25 AM Mahendra Singh Thalor > wrote: > > I think, Tushar point is that either we should allow both > > vacuum(parallel 0, full 1) and vacuum(parallel 1, full 0) or in the > > both cases, we should through error. > > Oh, yeah, good point. Somebody must not've been careful enough with > the options-checking code. Actually I think someone was too careful. From 9256cdb0a77fb33194727e265a346407921055ef Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 8 Apr 2020 11:38:36 -0500 Subject: [PATCH v1] parallel vacuum: options check to use same test as in vacuumlazy.c --- src/backend/commands/vacuum.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 351d5215a9..660c854d49 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -104,7 +104,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) bool freeze = false; bool full = false; bool disable_page_skipping = false; - bool parallel_option = false; ListCell *lc; /* Set default value */ @@ -145,7 +144,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) params.truncate = get_vacopt_ternary_value(opt); else if (strcmp(opt->defname, "parallel") == 0) { - parallel_option = true; if (opt->arg == NULL) { ereport(ERROR, @@ -199,7 +197,7 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) !(params.options & (VACOPT_FULL | VACOPT_FREEZE))); Assert(!(params.options & VACOPT_SKIPTOAST)); - if ((params.options & VACOPT_FULL) && parallel_option) + if ((params.options & VACOPT_FULL) && params.nworkers > 0) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot specify both FULL and PARALLEL options"))); -- 2.17.0 --Jl+DbTnyraiZ/loT Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="v1-0001-parallel-vacuum-options-check-to-use-same-test-as.patch" From 9256cdb0a77fb33194727e265a346407921055ef Mon Sep 17 00:00:00 2001 From: Justin Pryzby Date: Wed, 8 Apr 2020 11:38:36 -0500 Subject: [PATCH v1] parallel vacuum: options check to use same test as in vacuumlazy.c --- src/backend/commands/vacuum.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index 351d5215a9..660c854d49 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -104,7 +104,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) bool freeze = false; bool full = false; bool disable_page_skipping = false; - bool parallel_option = false; ListCell *lc; /* Set default value */ @@ -145,7 +144,6 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) params.truncate = get_vacopt_ternary_value(opt); else if (strcmp(opt->defname, "parallel") == 0) { - parallel_option = true; if (opt->arg == NULL) { ereport(ERROR, @@ -199,7 +197,7 @@ ExecVacuum(ParseState *pstate, VacuumStmt *vacstmt, bool isTopLevel) !(params.options & (VACOPT_FULL | VACOPT_FREEZE))); Assert(!(params.options & VACOPT_SKIPTOAST)); - if ((params.options & VACOPT_FULL) && parallel_option) + if ((params.options & VACOPT_FULL) && params.nworkers > 0) ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), errmsg("cannot specify both FULL and PARALLEL options"))); -- 2.17.0 --Jl+DbTnyraiZ/loT--