Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bIllY-0006Z9-Mt for pgsql-committers@arkaria.postgresql.org; Thu, 30 Jun 2016 23:53:04 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bIllX-0004Pb-Q7 for pgsql-committers@arkaria.postgresql.org; Thu, 30 Jun 2016 23:53:03 +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 1bIllX-0004PF-7t for pgsql-committers@postgresql.org; Thu, 30 Jun 2016 23:53:03 +0000 Received: from mail-it0-x229.google.com ([2607:f8b0:4001:c0b::229]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bIllT-0003YO-CM; Thu, 30 Jun 2016 23:53:02 +0000 Received: by mail-it0-x229.google.com with SMTP id a5so5151727ita.1; Thu, 30 Jun 2016 16:52:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=references:mime-version:in-reply-to:content-transfer-encoding :message-id:cc:from:subject:date:to; bh=eXuFsz0QBKxQN1U2KYbEzxU3TV9PP6ThwNQLCEIav0c=; b=Dv7O7yPt8FFqtmFQD+d6DiBJolz9EUHmRmfnWuR+nM3ri/0Ipv++LL96fFjn8MsKsO g+Dm7gCCqhMsApfhpIYoDJw3vjjcJ8aNWut1V2gmC33yJeLrsQIkX54abfwJD1BUwCUS VUr52zQy4ZhqlT4Ko/UWghM05p1/A4117LeJlxCxKMytxvipR83TWMJ+kJTHn9FnCJ4J 2GD2rxxrZUvqgTK6Kgo0vlCSv9HMOFtP73yScETbzC2XUN+0+8WWQzKTq8PRhTG2FN0e dBfDHjmPWMzyvX+MtbHhMzBZYZnpn33W7vYsVD3HcnvaXYiDwqs3Qq/sYzp38DdzfaaT 1HAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:references:mime-version:in-reply-to :content-transfer-encoding:message-id:cc:from:subject:date:to; bh=eXuFsz0QBKxQN1U2KYbEzxU3TV9PP6ThwNQLCEIav0c=; b=laCPAAIhTCV+D0ZjRQIIv9u/XeKWtszW3/gxORyPlUQmAevw+xPuDGEmZf6fmvUYm3 WqyLpMOpGbUXZe+iGyc0b0C5V9IlxBCdfMoRg6yGNOVlUOTM0Udx4tEF8bzSgZDmkeG+ tAbAowSsMUyAgnVqfgKstVSk+6iDvKcAQN/iRYyw0AX3/7UaKDc9cbY8/fF4RLYkzEhN SfwNS5gE0pB+ZN8XpyD3t4emJxsedNksEsug2S7YKyuLFE185VJfBz8+bd0DxHdsx1oN 6kBgmwkY5haPiJbF+oPfGp9OYSI5Y16uDY8ESFlxYJfUOUri0uzGCpagBXbC/KWLq45U 4qfw== X-Gm-Message-State: ALyK8tLoSxCn5YEMO2i13ei0Osg22+DUhXynDeUrm0NApR1357kXcrcdWYh3ipwNRGSeVQ== X-Received: by 10.36.39.147 with SMTP id g141mr28190570ita.0.1467330777625; Thu, 30 Jun 2016 16:52:57 -0700 (PDT) Received: from [10.51.163.32] (mobile-107-92-123-99.mycingular.net. [107.92.123.99]) by smtp.gmail.com with ESMTPSA id a36sm4966488ioj.2.2016.06.30.16.52.56 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 30 Jun 2016 16:52:56 -0700 (PDT) References: Mime-Version: 1.0 (1.0) In-Reply-To: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Message-Id: Cc: pgsql-committers@postgresql.org X-Mailer: iPhone Mail (13F69) From: Robert Haas Subject: Re: pgsql: Fix several mistakes around parallel workers and client_encoding Date: Thu, 30 Jun 2016 19:52:13 -0400 To: Robert Haas X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Actually, a significant part of this was derived from Peter's patch. I shou= ld have credited him as a co-author as well as a reviewer. I apologize for = the oversight. ...Robert > On Jun 30, 2016, at 6:46 PM, Robert Haas wrote: >=20 > Fix several mistakes around parallel workers and client_encoding. >=20 > Previously, workers sent data to the leader using the client encoding. > That mostly worked, but the leader the converted the data back to the > server encoding. Since not all encoding conversions are reversible, > that could provoke failures. Fix by using the database encoding for > all communication between worker and leader. >=20 > Also, while temporary changes to GUC settings, as from the SET clause > of a function, are in general OK for parallel query, changing > client_encoding this way inside of a parallel worker is not OK. > Previously, that would have confused the leader; with these changes, > it would not confuse the leader, but it wouldn't do anything either. > So refuse such changes in parallel workers. >=20 > Also, the previous code naively assumed that when it received a > NotifyResonse from the worker, it could pass that directly back to the > user. But now that worker-to-leader communication always uses the > database encoding, that's clearly no longer correct - though, > actually, the old way was always broken for V2 clients. So > disassemble and reconstitute the message instead. >=20 > Issues reported by Peter Eisentraut. Patch by me, reviewed by > Peter Eisentraut. >=20 > Branch > ------ > master >=20 > Details > ------- > http://git.postgresql.org/pg/commitdiff/10c0558ffefcd12bf1d3dc35587eba41d= 1ce4571 >=20 > Modified Files > -------------- > src/backend/access/transam/parallel.c | 18 +++++++++++++++++- > src/backend/commands/async.c | 5 +---- > src/backend/commands/variable.c | 24 ++++++++++++++++++++++++ > src/backend/libpq/pqformat.c | 30 ++++++++++++++++++++++++++++++ > src/backend/libpq/pqmq.c | 2 +- > src/include/commands/async.h | 4 ++++ > src/include/libpq/pqformat.h | 1 + > 7 files changed, 78 insertions(+), 6 deletions(-) >=20 >=20 > --=20 > Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) > To make changes to your subscription: > http://www.postgresql.org/mailpref/pgsql-committers --=20 Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers