redigo icon indicating copy to clipboard operation
redigo copied to clipboard

add pool FILO mode

Open tangtj opened this issue 3 years ago • 7 comments

tangtj avatar Dec 24 '21 04:12 tangtj

https://github.com/gomodule/redigo/pull/571

tangtj avatar Dec 24 '21 05:12 tangtj

There is already a https://github.com/gomodule/redigo/pull/571 for this. The same issue applies to this is that this breaks connection cleanup and is only needed to solve a problem outside of this package.

If I missed how this avoids the issue I’m all ears. However there is also the additional data race if the LIFO variable was ever changed on the fly.

With the current lack of a functional arg constructor, which would require a major version bump, I’m not sure there’s a way to fix 😞

stevenh avatar Dec 25 '21 00:12 stevenh

thanks you. We consulted the technical staff of the cloud vendor, and the solution given is this method. I am willing to participate in the follow-up and solve the related problems.

tangtj avatar Dec 25 '21 01:12 tangtj

Happy to consider options but from what I’ve read about the situation it would need a more situation aware solution to fix properly.

stevenh avatar Dec 25 '21 23:12 stevenh

I wonder if the best fix for this would be to limit the connection lifetime, which would force rebalance over time?

stevenh avatar Dec 31 '21 20:12 stevenh

If the lifetime is very short, Pool will be created and closed conn frequently. The use of pool is meaningless and is equivalent to creating a new conn every time. If the time is longer, for example, 20 seconds or 1 minute,Then the rebalan is has no effect,unbalanced state transfers on different connection,single unbalanced connection will still become the overall performance bottleneck。

tangtj avatar Jan 01 '22 12:01 tangtj

That would only be the case if the LB isn't doing it's job properly, and if that is the case no fix will work.

From what I understood the balance issue only occurred where there was an issue, hence a 1min max connection lifetime would enable it to only be unbalanced after said issue for 1mins, which would maintain the full benefit of the pool?

stevenh avatar Jan 04 '22 11:01 stevenh