core icon indicating copy to clipboard operation
core copied to clipboard

FreeServerFromClusterJob keeps rewiring cluster

Open wezell opened this issue 9 years ago • 3 comments

Not sure how I got into this state, but it is a state we need to handle. My computer goes to sleep and I think if it is asleep longer than the license timeout, the license gets released. The problem is that my server still shows that has a license. See image below:

screen shot 2017-10-10 at 3 00 48 pm

For some reason, the server never picks a license from the repo and this forces the FreeServerFromClusterJob to run and rewire the cluster every minute.

see: https://gist.github.com/wezell/49488e0bf28dabbc3db6bc7c38b1bd2d

wezell avatar Oct 10 '17 19:10 wezell

So here are my thoughts on this - I believe that this happens when my computer wakes up from a 30m sleep, the dotCMS runs the quartz jobs whose firing times were missed. My thinking is that the FreeServerFromClusterJob ran before the ServerHeartbeatJob which means that my server was removed from the cluster_server* and sitelic tables as a dead server BEFORE the it could write the heartbeat. When the heartbeat job ran, there was no server in the cluster_server table to register uptime for. Seems like these two jobs need to be combined to insure a consistent order.

Other thoughts:

  1. We have two places where we store a heartbeat. In the cluster_server_uptime table and in the sitelic table. We do not need both of these. I'd like to remove the redundant cluster_server_uptime table completely and just use the sitelic.lastping column.

  2. The FreeServerFromClusterJobis stateful so it is only getting run by one server in a cluster. If the other servers in the cluster need to rewire as well, they definitely will not do so.

wezell avatar Oct 11 '17 21:10 wezell

PR master: https://github.com/dotCMS/core/pull/12979 PR 2 ee: https://github.com/dotCMS/enterprise-2.x/pull/551 PR 3 ee: https://github.com/dotCMS/enterprise-2.x/pull/552

dsilvam avatar Oct 30 '17 21:10 dsilvam

Waiting for fix on https://github.com/dotCMS/core/issues/13018 to complete testing

shaydotcms avatar Nov 08 '17 20:11 shaydotcms