Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bsTUk-0003fy-LA for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2016 11:39:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bsTUk-0006kr-7v for pgsql-hackers@arkaria.postgresql.org; Fri, 07 Oct 2016 11:39:18 +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_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bsTUi-0006hM-85 for pgsql-hackers@postgresql.org; Fri, 07 Oct 2016 11:39:16 +0000 Received: from mail-lf0-x22e.google.com ([2a00:1450:4010:c07::22e]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bsTUf-0005Qd-WA for pgsql-hackers@postgresql.org; Fri, 07 Oct 2016 11:39:15 +0000 Received: by mail-lf0-x22e.google.com with SMTP id b81so38776629lfe.1 for ; Fri, 07 Oct 2016 04:39:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=HIIWjfLLX5nHzX3LKOrcUkgGjNjXKK+56KezPBoeB2E=; b=JxQt0/kMkaVWkblWI8uHU5bzlc95nUkLYuBY7YnvrF+W+Wd70l5Tg6dV4x6riBf7Xh rGDuhwGkVqL7sb4W08BVNBLKM0bvAr6jhS99uhp4Exne+TOlFB83O2tvY5FWiUKOdJaB LHqYD08sXrfnzbhcZA0QzyeuXvJzGLzNmXggs+pJvDBGSu4w4ZHNVL9w+PsXsTowQ8I8 rVMNWVuZ0VjU9M7nmadMsyj437JZm+fIjAuAWtMcW0KJViEgmQP18qxIxAI8nDMKPTHe +ZXsnQCEHuaL79ms9kQtFcxTqwTrZQMCZ77arRJxXSsBotmwQnUOkhPWaEJEHoLLBHcq Xv9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=HIIWjfLLX5nHzX3LKOrcUkgGjNjXKK+56KezPBoeB2E=; b=TzVxeZb4zFfKK8LbhIvPCFWa1gjglDH+M9vRrCX5ZSPJYCv6pLlpINMPSk16H74M1a kvBI9+EGO29jx9NqBCY4aBAgKA+POZcQ0tKTdiFJvU+ksbntK1gPnVgrPrfSoDhu91Lx nGWFcl9oUqZfSWi/02FBPwzeLfIgGTm0IlSaE1PDRMmDAh7nVtXA9rt2Ec2quh2odF+P SAr6RhXFBqI60ii4l8o45bBoimIiyNyTAF0ld2Q++G6ubRChjXbqKo/XLBp+x/KDKU8U QkVQ6Rxkr7BoroTBBuZnL42zW/2sqHG1f4VoZj+HkBYyOITsXE3zT9gTX4I2ZxMtIyIy D+uA== X-Gm-Message-State: AA6/9RnotPmWCuJoIriYUO//WAMNLk4qPO5WlFvChftFLomP4hjHIYfOVuUZEagJBOR8kg== X-Received: by 10.46.69.212 with SMTP id s203mr6739148lja.72.1475840351393; Fri, 07 Oct 2016 04:39:11 -0700 (PDT) Received: from [192.168.1.111] (dsl-hkibrasgw1-58c38f-82.dhcp.inet.fi. [88.195.143.82]) by smtp.gmail.com with ESMTPSA id b79sm3531963lfh.1.2016.10.07.04.39.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Oct 2016 04:39:10 -0700 (PDT) Subject: Re: pg_rewind: Should abort if both --source-pgdata and --source-server are specified To: Michael Banck , pgsql-hackers@postgresql.org References: <20161007103414.GD12247@nighthawk.caipicrew.dd-dns.de> From: Heikki Linnakangas Message-ID: <6f3dd14e-acf4-1bc2-0f0a-5c8eebe92de4@iki.fi> Date: Fri, 7 Oct 2016 14:39:09 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.2.0 MIME-Version: 1.0 In-Reply-To: <20161007103414.GD12247@nighthawk.caipicrew.dd-dns.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 10/07/2016 01:34 PM, Michael Banck wrote: > Hi, > > ISTM that pg_rewind's --source-pgdata and --source-server options are > mutually exclusive, and the synopsis in the documentation seems to > indicate that as well: > > |pg_rewind [option...] {-D | --target-pgdata} directory > |{--source-pgdata=directory | --source-server=connstr} > > However, there is no such check in the code. > > I've seen people assume --source-pgdata is supposed to be the data > directory location on the remote server if they specify --source-server > as well, and are then confused by error messages. > > So I think pg_rewind should abort in this case. Patch for that attached. Agreed. Committed, thanks! - Heikki -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers