This reverts commit
9022ff842fb5dbbe06e2f2f4cf38fadf47b592da.
With the commit, write queries are always sent to node 0 even if the
primary node is not 0 because PRIMARY_NODE_ID macro returns
REAL_MASTER_NODE_ID, which is usually 0. Thus write queries are failed
with:
ERROR: cannot execute INSERT in a read-only transaction
* mode or there's no primary node, this macro returns
* REAL_MASTER_NODE_ID.
*/
-#define PRIMARY_NODE_ID (Req_info->primary_node_id >=0 && VALID_BACKEND(Req_info->primary_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)