This is the main function implementing cluster functionality. It is a blocking function, so it should be called in a separate thread.
MCO_RET mco_cluster_listen ( /*IN*/ mco_db_h db )
db | connection to database |
This function receives messages from other nodes, executes remote transactions, monitors the status of the local transactions, sends a keep-alive message, and other responsibilities. It is a blocking function, so it should be called in a separate thread. This thread must be started immediately after the mco_cluster_db_open()
call, on each cluster node.
MCO_S_OK | The cluster has been properly initialized. In this case all nodes will contain identical copies of the database |
MCO_E_CLUSTER_NOQUORUM | Some nodes were down, and the remaining nodes do not constitute a quorum |
MCO_E_CLUSTER_NOT_INITIALIZED | The database was not created by mco_cluster_db_open(). Note: it may have been created by mco_db_open_dev() by mistake |
MCO_E_CLUSTER_PROTOCOLERR | Protocol error during transaction replication |