/*
 * The first DB node id appears in pgpool.conf or the first "live" DB
 * node otherwise.
 */
#define REAL_MASTER_NODE_ID (Req_info->master_node_id)

/*
 * The primary node id in streaming replication mode. If not in the
 * mode or there's no primary node, this macro returns
 * REAL_MASTER_NODE_ID.
 */
#define PRIMARY_NODE_ID (Req_info->primary_node_id >=0?\
                         Req_info->primary_node_id:REAL_MASTER_NODE_ID)
#define IS_PRIMARY_NODE_ID(node_id)    (node_id == PRIMARY_NODE_ID)

/*
 * Real primary node id. If not in the mode or there's no primary
 * node, this macro returns -1.
 */
#define REAL_PRIMARY_NODE_ID (Req_info->primary_node_id)

/*
 * "Virtual" master node id. It's same as REAL_MASTER_NODE_ID if not
 * in load balance mode. If in load balance, it's the first load
 * balance node.
 */
#define MASTER_NODE_ID (pool_virtual_master_db_node_id())
#define IS_MASTER_NODE_ID(node_id) (MASTER_NODE_ID == (node_id))
#define MASTER_CONNECTION(p) ((p)->slots[MASTER_NODE_ID])
#define MASTER(p) MASTER_CONNECTION(p)->con

#define REPLICATION (pool_config->replication_mode)
#define MASTER_SLAVE (pool_config->master_slave_mode)
#define STREAM (MASTER_SLAVE && pool_config->master_slave_sub_mode == STREAM_MODE)
#define SLONY (MASTER_SLAVE && pool_config->master_slave_sub_mode == SLONY_MODE)
#define DUAL_MODE (REPLICATION || MASTER_SLAVE)
#define RAW_MODE (!REPLICATION && !MASTER_SLAVE)

最新文章

  1. 基于webpack使用ES6新特性(转载)
  2. 【opencv】轮廓相关
  3. unity, particleSystem的batch优化
  4. java commons-lang 工具包 逃脱工具 转unicode 及其他
  5. MySQL分库分表环境下全局ID生成方案
  6. myeclipse解决JSP文件script调整背景颜色
  7. [leetcode-516-Longest Palindromic Subsequence]
  8. Quick Sort(Java)
  9. 994.Contiguous Array 邻近数组
  10. 消息中间件系列五:RabbitMQ的使用场景(异步处理、应用解耦)
  11. create table 推荐规则
  12. 在平衡树的海洋中畅游(一)——Treap
  13. 大数据入门到精通2--spark rdd 获得数据的三种方法
  14. 12.Scrapy与mongodb交互和设置中间键
  15. Oracle EBS INV 创建物料搬运单
  16. cloudstack 创建虚拟机失败
  17. Codeforces Round #323 (Div. 2) E - Superior Periodic Subarrays
  18. Unit01: jQuery概述 、 jQuery选择器 、 jQuery操作DOM
  19. 1083 Moving Tables
  20. Leetcode 001. 两数之和(扩展)

热门文章

  1. 易观OLAP算法大赛结果揭晓,开源组黑马放大招!
  2. jQuery中Ajax的几种写法
  3. mac安装win10后触摸板没有右键功能键的添加技巧
  4. Centos7下 yum安装php扩展
  5. lsync 负载实现代码双向同步
  6. 何为JQuery对象?
  7. navicat Premium远程链接mysql报错
  8. 中国电信线CTF线下选拨writeup
  9. 【hiho一下第十二周】刷油漆
  10. [SharePoint][SharePoint Designer 入门经典]Chapter11 工作流基础