瀏覽代碼

[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 年之前
父節點
當前提交
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
 		return healthCheck
 	
 	
 	clusterHealthCheckBuilder: (client) ->
 	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) ->
 	_checkClient: (client, callback) ->
 		callback = _.once(callback)
 		callback = _.once(callback)