From a53eef5e3d1b617e35bc8ad5a64e6ed2c62a225c Mon Sep 17 00:00:00 2001 From: Jakob Ackermann Date: Mon, 23 Sep 2019 12:41:53 +0200 Subject: [PATCH] [healthCheck] bring back support for redis cluster Assume `cluster-require-full-coverage=yes` is set for the redis cluster, which is the default value. We are writing into a single hash slot, resulting in a partial health check only. The 'cluster-require-full-coverage=yes' blocks writes as soon as any hash slot is not covered by an active primary. We are leveraging the health check build into the redis cluster topology to bring the scope of the single read/write/delete to the full cluster. REF: 1b3566d6c830289dc826da1d13b75d68205d8dec Signed-off-by: Jakob Ackermann --- libraries/redis-wrapper/index.coffee | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/libraries/redis-wrapper/index.coffee b/libraries/redis-wrapper/index.coffee index bcb97d4657..88e97c9dac 100644 --- a/libraries/redis-wrapper/index.coffee +++ b/libraries/redis-wrapper/index.coffee @@ -37,12 +37,7 @@ module.exports = RedisSharelatex = return healthCheck clusterHealthCheckBuilder: (client) -> - healthCheck = (callback) -> - jobs = client.nodes("all").map (node) => - (cb) => RedisSharelatex._checkClient(node, cb) - async.parallel jobs, callback - - return healthCheck + return RedisSharelatex.singleInstanceHealthCheckBuilder(client) _checkClient: (client, callback) -> callback = _.once(callback)