zoukankan      html  css  js  c++  java
  • pgpool中定义的数据库节点及pgpool支持的复制模式

    /*
     * 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)

  • 相关阅读:
    c# 服务
    c#调用腾讯云API的实例
    c#的WebService和调用
    基于H5的WebSocket简单实例
    Windows server 2008 R2配置多个远程连接
    把本地项目上传到git服务器的步骤
    swagger-ui中@ApiOperation实例
    VUE学习系列--(一)
    IntelliJ IDEA自动添加类注释和方法注释
    Jeecg-Cloud学习之路(二)
  • 原文地址:https://www.cnblogs.com/songyuejie/p/7053673.html
Copyright © 2011-2022 走看看