Why does stado need to checkConnections() before every commit()

Asked by chenbaiping

In the function commit() of MultinodeExecutor class, before sending the NodeMessage MSG_TRAN_COMMIT, Stado calls the function checkConnections(). But it seems that stado had never used the return values of the checkConnections().

What is its purpose ? Can I remove it?

In checkConnection(), it sends a PING msg to each node , and let each node to execute a 'select 1' command. In some cases it makes the low performance.

Question information

Language:
English Edit question
Status:
Solved
For:
Stado Edit question
Assignee:
No assignee Edit question
Solved by:
chenbaiping
Solved:
Last query:
Last reply:
Revision history for this message
chenbaiping (4bjwb) said :
#1

I read the code carefully and now I know why.
When some nodes have lost their connections, checkConnections() will throw an XDBServerException, then stado will roll back the commit on each node.