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 1jBfEs-0004Xq-VC for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2020 13:48:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1jBfEr-0000cR-Qs for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Mar 2020 13:48:05 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1jBfEq-0000aP-Mo for pgsql-hackers@lists.postgresql.org; Tue, 10 Mar 2020 13:48:05 +0000 Received: from [64.147.123.20] (helo=wout4-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jBfEn-0008Ka-HH for pgsql-hackers@postgresql.org; Tue, 10 Mar 2020 13:48:03 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D18D0A22; Tue, 10 Mar 2020 09:47:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Tue, 10 Mar 2020 09:47:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=8fasNCN7bwM8aFtCwavSlZlarNXyWpKcFTFnC22fx 5s=; b=hKnRQER54CjxuG73e8f2G9u0nxcqsYtT09grncE6egulG1M4slUvekO54 x48fuL7mYZhFFpkQJ0G/BTbXOOAn+FsxQxQxI1MtGqn1OuWJniEkmrKycsU5Vd0q Qu3NKJQvRNX+SkzCxam/xsTzbj//W+Kw1NxEeZGOn9wOB2dMVTxhtfNRkrgT97CO rDUeZ7Y971+8Go6LRqcaXF0UTx6BbGOvJf7vrmjgEEx+4Zvn5LWhD5Z2fQNFnie6 UqCkEor+bTCuPKjFGOvs0ktnTGvzzzN8eV0Pet7eW2VgjDG63kNjTImlGPJNCLXu naKhdAFhQJNBt/kaRsrxXdyGKHAXA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedruddvtddgheehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefuvfhfhfhokffffgggjggtgfesth ejredttdefjeenucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgv rhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhmqeenucffohhmrg hinhepvdhnughquhgrughrrghnthdrtghomhenucfkphepleefrddvgedvrddvudefrddv gedunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepph gvthgvrhdrvghishgvnhhtrhgruhhtsedvnhguqhhurggurhgrnhhtrdgtohhm X-ME-Proxy: Received: from april.pezone.net (p5df2d5f1.dip0.t-ipconnect.de [93.242.213.241]) by mail.messagingengine.com (Postfix) with ESMTPA id 20765328006A; Tue, 10 Mar 2020 09:47:48 -0400 (EDT) Subject: Re: Improve handling of parameter differences in physical replication To: Kyotaro Horiguchi , masahiko.sawada@2ndquadrant.com References: <20200310.175755.1250389993502025042.horikyota.ntt@gmail.com> Cc: alvherre@2ndquadrant.com, pgsql-hackers@postgresql.org From: Peter Eisentraut Organization: 2ndQuadrant Message-ID: Date: Tue, 10 Mar 2020 14:47:47 +0100 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20200310.175755.1250389993502025042.horikyota.ntt@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Host-Lookup-Failed: Reverse DNS lookup failed for 64.147.123.20 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2020-03-10 09:57, Kyotaro Horiguchi wrote: >> Well I meant to periodically send warning messages while waiting for >> parameter change, that is after exhausting resources and stopping >> recovery. In this situation user need to notice that as soon as >> possible. > > If we lose connection, standby continues to complain about lost > connection every 5 seconds. This is a situation of that kind. My argument is that it's not really the same. If a standby is disconnected for more than a few minutes, it's really not going to be a good standby anymore after a while. In this case, however, having certain parameter discrepancies is really harmless and you can run with it for a long time. I'm not strictly opposed to a periodic warning, but it's unclear to me how we would find a good interval. > By the way, when I reduced max_connection only on master then take > exclusive locks until standby complains on lock exchaustion, I see a > WARNING that is saying max_locks_per_transaction instead of > max_connection. > > > WARNING: insufficient setting for parameter max_connections > DETAIL: max_connections = 2 is a lower setting than on the master server (where its value was 3). > HINT: Change parameters and restart the server, or there may be resource exhaustion errors sooner or later. > CONTEXT: WAL redo at 0/60000A0 for XLOG/PARAMETER_CHANGE: max_connections=3 max_worker_processes=8 max_wal_senders=2 max_prepared_xacts=0 max_locks_per_xact=10 wal_level=replica wal_log_hints=off track_commit_timestamp=off > WARNING: recovery paused because of insufficient setting of parameter max_locks_per_transaction (currently 10) > DETAIL: The value must be at least as high as on the primary server. > HINT: Recovery cannot continue unless the parameter is changed and the server restarted. > CONTEXT: WAL redo at 0/6004A80 for Standb This is all a web of half-truths. The lock tables are sized based on max_locks_per_xact * (MaxBackends + max_prepared_xacts). So if you run out of lock space, we currently recommend (in the single-server case), that you raise max_locks_per_xact, but you could also raise max_prepared_xacts or something else. So this is now the opposite case where the lock table on the master was bigger because of max_connections. We could make the advice less specific and just say, in essence, you need to make some parameter changes; see earlier for some hints. -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services