[Postgres-xl-developers] what does the XCP mean?

Koichi Suzuki koichi.dbms at gmail.com
Tue Jul 14 01:20:22 PDT 2015


#ifdef PGXC is used both for coordinator or datanode.   Because coordinator
and datanode share the same binary, we need to check which mode it is
running at runtime.

This should be done at runtime and are done as follows:

IS_PGXC_COORDINATOR && !IsConnFromCoord()


IS_PGXC_COORDINATOR tells that it is running as a coordinator,
 IS_PGXC_DATANODE tells that it is running as a datanode.

IsConnFromCoord() tells that current transaction is invoked from other
coordinator.

You will find these check in veracious part of the code.

Regards;

---
Koichi Suzuki
https://www.linkedin.com/in/koichidbms


2015-07-14 16:52 GMT+09:00 Rui Hai Jiang <ruihaijiang at msn.com>:

>  Hello,
> I’m looking at the following code.
>
> I don’t know what  #ifndef XCP means here.
>
> Is the function pgxc_planner used for a Coordinator or a datanode?
>
>
> PlannedStmt *
> planner(Query *parse, int cursorOptions, ParamListInfo boundParams)
> {
>  PlannedStmt *result;
>
>  if (planner_hook)
>   result = (*planner_hook) (parse, cursorOptions, boundParams);
>  else
> #ifdef PGXC
> #ifndef XCP
>   /*
>    * A Coordinator receiving a query from another Coordinator
>    * is not allowed to go into PGXC planner.
>    */
>   if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
>    result = pgxc_planner(parse, cursorOptions, boundParams);
>   else
> #endif /* XCP */
> #endif /* PGXC */
>    result = standard_planner(parse, cursorOptions, boundParams);
>  return result;
> }
>
>
> ------------------------------------------------------------------------------
> Don't Limit Your Business. Reach for the Cloud.
> GigeNET's Cloud Solutions provide you with the tools and support that
> you need to offload your IT needs and focus on growing your business.
> Configured For All Businesses. Start Your Cloud Today.
> https://www.gigenetcloud.com/
> _______________________________________________
> Postgres-xl-developers mailing list
> Postgres-xl-developers at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/postgres-xl-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.postgres-xl.org/private.cgi/postgres-xl-developers-postgres-xl.org/attachments/20150714/3dad8850/attachment.htm>


More information about the Postgres-xl-developers mailing list