You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the mysql library which is used as inspiration for this library and has quite similar API, PoolCluster has the attribute restoreNodeTimeout: a node which failed the number of times removeNodeErrorCount can be recovered to the cluster after the time specified in restoreNodeTimeout.
mysql2 has a more radical behavior by which a node is removed from the cluster forever after the removeNodeErrorCount
In our use case, we have several remote nodes; anytime one of the nodes could become unavailable, and be later recovered. With the current mysql2 behavior it will not be included again in the cluster; eventually, all nodes could become unavailable at some points, meaning the cluster will be empty, even when some nodes are available.
Rather than trying to solve it on the application, by detecting that a node has been removed from the cluster and adding it again, it would be nice if mysql2 could recover those nodes after an specified time, in a similar way as mysql implements.
The text was updated successfully, but these errors were encountered:
PoolCluster is almost entirely reused/copied from mysqljs/mysql, if there are newer changes there I'm happy to see them backported. PRs welcome @juliomarmin :)
With PoolCluster, disconnected connections will count as errors against the
related node, incrementing the error code for that node. Once there are more than
`removeNodeErrorCount` errors on a given node, it is removed from the cluster.
When this occurs, the PoolCluster may emit a `POOL_NONEONLINE` error if there are
no longer any matching nodes for the pattern. The `restoreNodeTimeout` config can
be set to restore offline nodes after a given timeout.
In the mysql library which is used as inspiration for this library and has quite similar API, PoolCluster has the attribute
restoreNodeTimeout
: a node which failed the number of timesremoveNodeErrorCount
can be recovered to the cluster after the time specified inrestoreNodeTimeout
.mysql2 has a more radical behavior by which a node is removed from the cluster forever after the
removeNodeErrorCount
In our use case, we have several remote nodes; anytime one of the nodes could become unavailable, and be later recovered. With the current mysql2 behavior it will not be included again in the cluster; eventually, all nodes could become unavailable at some points, meaning the cluster will be empty, even when some nodes are available.
Rather than trying to solve it on the application, by detecting that a node has been removed from the cluster and adding it again, it would be nice if mysql2 could recover those nodes after an specified time, in a similar way as mysql implements.
The text was updated successfully, but these errors were encountered: