Comments (7)
I did some research, and this is indeed a similar problem with the issue you mentioned. If you only call AsyncRedisCluster::redis
to create an AsyncRedis
object, and send command with this object, redis-plus-plus does not update the underlying node-slot mapping, and always send command to the old master.
Thanks for reporting the bug, and I'll try to fix it ASAP.
Before that, you can work around it by calling AsyncRedisCluster::get
with the key you used, once you get an exception. This way, the underlying node-slot mapping will be updated, and redis-plus-plus will follow the MOVED indication.
Regards
from redis-plus-plus.
I fixed the problem, please try the latest code on dev branch. After some more tests, I'll merge the code into master branch.
You can use the following code to do a test:
auto cluster = RedisCluster("redis://127.0.0.1:7000");
while (true) {
try {
auto r = cluster.redis(key, false);
cout << r.command<string>("ping") << endl;
} catch (const Error &e) {
cout << e.what() << endl;
}
At the beginning, the test program prints "PONG". When the master that key located, is down, the program prints error message. When a new master is elected, the program prints "PONG" again.
You can try the latest fix. If you still has problem with it, feel free to let me know.
Sorry for the late fix. Too busy these days.
Regards
from redis-plus-plus.
Code has been merged into master branch. If you still have problem with it, feel free to reopen it.
Regards
from redis-plus-plus.
New release has been created. Enjoy it!
Regards
from redis-plus-plus.
Hi @sewenew , I'm facing the same issue, so please a quick correction would be more than welcome!
from redis-plus-plus.
Thanks a lot for the fix, could you please create a new release that includes the fix so as to incorporate it in our project?
from redis-plus-plus.
from redis-plus-plus.
Related Issues (20)
- [BUG] memory leak detected when calling AsyncRedisCluster::redis(sw::redis::StringView const&, bool) HOT 3
- [QUESTION] different behavior for async and sync cluster HOT 5
- Issue with Specific Redis Plus Plus Exceptions Not Being Caught HOT 6
- version info at compile HOT 4
- Use of REDIS_SSL_VERIFY_NONE probably needs to be documented HOT 1
- [BUG] "hiredis_features.h" race when doing multiple out-of-source tree builds HOT 2
- [FEATURE] apply new TLS settings after cert renewal HOT 6
- [QUESTION] How to control redis++ reconnect? such as reconnect interval, health status etc HOT 4
- [FEATURE] Request ReplyUPtr expose at Redis++ Async response HOT 4
- [BUG?]memory accumulation causes oom HOT 2
- [BUG] -DCMAKE_PREFIX_PATH not finding hiredis HOT 1
- request timeout[QUESTION] HOT 3
- [BUG] AsyncRedisCluster keep cost fd at idle state HOT 6
- [FEATURE] Support for LMOVE / BLMOVE HOT 2
- [QUESTION] Cluster slots polling HOT 6
- [QUESTION] Shared Connection pool for redis between services HOT 4
- [QUESTION] The program will be terminated when exception occurs during the automatic unlocking HOT 3
- how many nodes will redis cluster subscriber connect to HOT 6
- [QUESTION] Unable to use std::optional with redis++ with cpp17 on ubuntu HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from redis-plus-plus.