Просмотр исходного кода

[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 <das7pad@outlook.com>
Jakob Ackermann 7 лет назад
Родитель
Сommit
a53eef5e3d
1 измененных файлов с 1 добавлено и 6 удалено
  1. 1 6
      libraries/redis-wrapper/index.coffee

+ 1 - 6
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)