handle redis connection issues.
improve consisten algorithm.