[Postgres-xl-developers] [patch]catch and report error when init connection on coord

Jov amutu at amutu.com
Mon Dec 29 17:10:20 PST 2014


Thanks!

Jov
blog: http:amutu.com/blog <http://amutu.com/blog>

2014-12-30 0:17 GMT+08:00 Mason Sharp <msharp at translattice.com>:

> Hi Jov,
>
> I just pushed this into the repository. Sorry for the slow response. Many
> are on vacation (including myself) because of the Christmas and New Year's
> holidays.
>
>
>
> On Sun, Dec 28, 2014 at 9:26 PM, Jov <amutu at amutu.com> wrote:
>
>> Any one review this?
>>
>> Jov
>> blog: http:amutu.com/blog <http://amutu.com/blog>
>>
>> 2014-12-19 12:53 GMT+08:00 Jov <amutu at amutu.com>:
>>
>>> problem desc:
>>> pgxl init datanode connection with set global_session,this set stmt can
>>> be failed on datanode(for example:if the datanode do not have the coord
>>> info on it's pgxc_node,it will report error such as ""node
>>> ""coord1_2118"" does not exist"" when running the set cmd),but the
>>> error on datanode do not catch on the coord.So if you run a insert stmt on
>>> the coord,it will not report error,but the data do in the table.
>>>
>>> this patch fix it by catch and report error:
>>>
>>>> postgres=# insert into kv values(11,'3_11');
>>>> ERROR:  Could not begin transaction on data node.
>>>
>>>
>>> diff --git a/src/backend/pgxc/pool/pgxcnode.c
>>> b/src/backend/pgxc/pool/pgxcnode.c
>>> index 7a01b18..7b816bb 100644
>>> --- a/src/backend/pgxc/pool/pgxcnode.c
>>> +++ b/src/backend/pgxc/pool/pgxcnode.c
>>> @@ -2885,9 +2885,18 @@ pgxc_node_set_query(PGXCNodeHandle *handle, const
>>> char *set_query)
>>>                         continue;
>>>                 }
>>>                 msgtype = get_message(handle, &msglen, &msg);
>>> +
>>>                 /*
>>> -                * Ignore any response except ReadyForQuery, it allows
>>> to go on.
>>> +                * Ignore any response except ErrorResponse and
>>> ReadyForQuery, it allows to go on.
>>>                  */
>>> +
>>> +               if (msgtype == 'E')         /* ErrorResponse */
>>> +               {
>>> +                   handle->error = pstrdup(msg);
>>> +                   handle->state = DN_CONNECTION_STATE_ERROR_FATAL;
>>> +                   break;
>>> +               }
>>> +
>>>                 if (msgtype == 'Z') /* ReadyForQuery */
>>>                 {
>>>                         handle->transaction_status = msg[0];
>>>
>>> Jov
>>> blog: http:amutu.com/blog <http://amutu.com/blog>
>>>
>>
>>
>>
>> ------------------------------------------------------------------------------
>> Dive into the World of Parallel Programming! The Go Parallel Website,
>> sponsored by Intel and developed in partnership with Slashdot Media, is
>> your
>> hub for all things parallel software development, from weekly thought
>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>> look and join the conversation now. http://goparallel.sourceforge.net
>> _______________________________________________
>> Postgres-xl-developers mailing list
>> Postgres-xl-developers at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>>
>>
>
>
> --
> Mason Sharp
>
> TransLattice - http://www.translattice.com
> Clustered and Distributed Database Solutions
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20141230/4ca91929/attachment.htm>


More information about the Postgres-xl-developers mailing list