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.89) (envelope-from ) id 1iDs5t-0006Fl-NF for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 15:23:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDs5s-0008Dj-JQ for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 15:23:40 +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 1iDs5s-0008Dc-B0 for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2019 15:23:40 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDs5p-0004LV-EB for pgsql-hackers@postgresql.org; Fri, 27 Sep 2019 15:23:39 +0000 Received: by mail-qt1-x844.google.com with SMTP id c21so7695688qtj.12 for ; Fri, 27 Sep 2019 08:23:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=FrGvyB0mXfARnj/djhc3/JFATuxrd0qZylyl/IYTBmE=; b=SYdRz1qi6/dkizNiHytKWRT+1UUi05E+v/wqh9XTTKkzeT8Hnd4y3L2a8Iwx+Fs3O5 mn+1paOjRDeUtlOMvVZtSdEYJDfVb0WkHHvCMfRZZvLvwR302mrd8klpdj63Z/jbfiWC WO16hSRAh/6uRbZOBacb99I2gZISTXWmCORn+3UUO8FZvRpXuPyex4hp/CYJL2pqXv3W QLrgLGiCn6RJsZkRdr37pY+5jNrJAU4iJrHHMahJpUhrII/39EfvoBuqAREUuwkZTZzF RhD3aCU+isnLEdsIVKGdBJqPIn/HIREXt+hlY+bxvZ7svq2zfnmphXhk+XtosTQwEIhd +0Wg== 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:content-transfer-encoding:in-reply-to :user-agent; bh=FrGvyB0mXfARnj/djhc3/JFATuxrd0qZylyl/IYTBmE=; b=FvckLhQSsgks0nXIeBacx4n3c7PBlDifGTH5iVhpEVq1ynVsJmDwxyRgcyhPbpmh0g Qiazsx9909synX4FHm114j4JenmbkIjfBs/Y/OiVAHDRzhL2WlYcDjBqCB31U+sm7mNL gH2aM+ofm/UZbt+gvmEAsAkBxtc1OVVRpD7wjbaMY/LX0X0kmM0RdKJCWrO8NgCxam/q SZe7cbLtXKmiE8ur8z+6B1aFhWNqX2SNIakLjnGa2eoCCbIkwkEAjkv4N70enmVY1ETl FGm0vbZnzhW/mjuRiGfwIEZY2i0XoBk92HW/ZPYJbD3y2VP+kTZ405Vi5tg1zmFJuY3p aXYA== X-Gm-Message-State: APjAAAUCbPNpWzrq8g5t3g2d2OH9e0vaanQKf9zUEKznni2YhhxqcR6P 1acrHmuSkzdRN5u47YxEwSR8kw== X-Google-Smtp-Source: APXvYqx8qVjBKO9+N/9LHAKs5yzM2WuakfVuFL+Ih+jglrabFQlrzI5DC/akPxFnei1xVDPLSZ7AvQ== X-Received: by 2002:a0c:9276:: with SMTP id 51mr8003932qvz.35.1569597815375; Fri, 27 Sep 2019 08:23:35 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([191.125.227.87]) by smtp.gmail.com with ESMTPSA id 56sm4249251qty.15.2019.09.27.08.23.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 08:23:34 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 67E5F1206A9; Fri, 27 Sep 2019 11:28:18 -0300 (-03) Date: Fri, 27 Sep 2019 11:28:18 -0300 From: Alvaro Herrera To: Alexey Kondratov Cc: Paul Guo , Michael Paquier , Thomas Munro , pgsql-hackers , Jimmy Yih , Ashwin Agrawal Subject: Re: Two pg_rewind patches (auto generate recovery conf and ensure clean shutdown) Message-ID: <20190927142818.GA20414@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <2f726102-3f1e-bf16-061e-501919473ace@postgrespro.ru> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-27, Alexey Kondratov wrote: > 1) Maybe I've missed it somewhere in the thread above, but currently > pg_rewind allows to run itself with -R and --source-pgdata. In that case -R > option is just swallowed and neither standby.signal, nor > postgresql.auto.conf is written, which is reasonable though. Should it be > stated somehow in the docs that -R option always has to go altogether with > --source-server? Or should pg_rewind notify user that options are > incompatible and no recovery configuration will be written? Hmm I think it should throw an error, yeah. Ignoring options is not good. > + # Now, when pg_rewind apparently succeeded with minimal permissions, > + # add REPLICATION privilege. So we could test that new standby > + # is able to connect to the new master with generated config. > + $node_standby->psql( > + 'postgres', "ALTER ROLE rewind_user WITH REPLICATION;"); I think this better use safe_psql. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services