Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redis cluster Pool is not work correctly #21

Open
linuxpham opened this issue Apr 14, 2015 · 2 comments
Open

Redis cluster Pool is not work correctly #21

linuxpham opened this issue Apr 14, 2015 · 2 comments

Comments

@linuxpham
Copy link

Hi Mr,
After compiled the tests/cluster_pool.cpp, It can not run successfully.

There is an error as this output :

Running 2 test cases...
unknown location(0): fatal error in "set_key": std::runtime_error: regex_error
/data/svn/sources/redis3m/tests/cluster_pool.cpp(26): last checkpoint

*** 1 failure detected in test suite "redis3m"

Redis cluster :
Starting 30001 - localhost - master
Starting 30002 - localhost - master
Starting 30003 - localhost - master
Starting 30004 - localhost - slave
Starting 30005 - localhost - slave
Starting 30006 - localhost - slave

Modified code tests/cluster_pool.cpp:

include "common.h"

include <boost/assign/list_of.hpp>

using namespace redis3m;

cluster_pool::ptr_t get_pool()
{
std::vector<std::pair<std::string, unsigned int>> arrPairCluster;
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30001));
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30002));
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30003));
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30004));
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30005));
arrPairCluster.push_back(std::pair<std::string, unsigned int>("localhost", 30006));
return redis3m::cluster_pool::create(arrPairCluster);
}

BOOST_AUTO_TEST_CASE( create)
{
BOOST_CHECK_NO_THROW(get_pool());
}

BOOST_AUTO_TEST_CASE( set_key)
{
redis3m::cluster_pool::ptr_t pool = get_pool();
BOOST_CHECK_EQUAL("OK", pool->run(command("SET")("foo")("bar")));
BOOST_CHECK_EQUAL("bar", pool->run(command("GET")("foo")));
//BOOST_CHECK_EQUAL(reply::type_t::NIL, pool->run(command("GET")("test")).type());

}

What is wrong in this case ?

Thanks

@luca3m
Copy link
Owner

luca3m commented Apr 14, 2015

Are you using GCC may be? Some versions of GCC does not implement std::regex related stuff of C++11. Anyway I have to say to you that redis cluster support is just a proof of concept right now.

@linuxpham
Copy link
Author

Yes, i agree.
After update the GCC (4.9), it works successfully.
Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants