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

Error while reading from redis slave #61

Open
Krittam opened this issue Aug 15, 2020 · 1 comment
Open

Error while reading from redis slave #61

Krittam opened this issue Aug 15, 2020 · 1 comment

Comments

@Krittam
Copy link

Krittam commented Aug 15, 2020

Using version 2.0.0

I've created a redis backed bloom filter using this code
new FilterBuilder(5000000, 0.01) .redisBacked(true) .name(id) .redisHost(redisMaster) .addReadSlave(redisSlave1, REDIS_PORT) .addReadSlave(redisSlave2, REDIS_PORT) .password(redisPassword) .buildBloomFilter());

Inserted some test elements to it

Used below code in some other application to access the above filter
new FilterBuilder(5000000, 0.01) .redisBacked(true) .name(bloomFilterId) .overwriteIfExists(false) .redisHost(redisMaster) .addReadSlave(redisSlave1, REDIS_PORT) .addReadSlave(redisSlave2, REDIS_PORT) .password(redisPassword) .buildBloomFilter();

Now when i use
bf.contains("testElement")
it triggers below exception

redis.clients.jedis.exceptions.JedisConnectionException: Could not get a resource from the pool
        at redis.clients.util.Pool.getResource(Pool.java:53)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:226)
        at redis.clients.jedis.JedisPool.getResource(JedisPool.java:16)
        at orestes.bloomfilter.redis.helper.RedisPool.safelyReturn(RedisPool.java:94)
        at orestes.bloomfilter.redis.helper.RedisPool.transactionallyDo(RedisPool.java:110)
        at orestes.bloomfilter.redis.RedisBitSet.getBulk(RedisBitSet.java:47)
        at orestes.bloomfilter.redis.RedisBitSet.isAllSet(RedisBitSet.java:179)
        at orestes.bloomfilter.redis.BloomFilterRedis.contains(BloomFilterRedis.java:103)
        at orestes.bloomfilter.BloomFilter.contains(BloomFilter.java:64)
 Caused by: redis.clients.jedis.exceptions.JedisConnectionException: java.net.ConnectException: Connection refused (Connection refused)
        at redis.clients.jedis.Connection.connect(Connection.java:207)
        at redis.clients.jedis.BinaryClient.connect(BinaryClient.java:93)
        at redis.clients.jedis.BinaryJedis.connect(BinaryJedis.java:1767)
        at redis.clients.jedis.JedisFactory.makeObject(JedisFactory.java:106)
        at org.apache.commons.pool2.impl.GenericObjectPool.create(GenericObjectPool.java:868)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:435)
        at org.apache.commons.pool2.impl.GenericObjectPool.borrowObject(GenericObjectPool.java:363)
        at redis.clients.util.Pool.getResource(Pool.java:49)
        ... 39 more
Caused by: java.net.ConnectException: Connection refused (Connection refused)
        at java.base/java.net.PlainSocketImpl.socketConnect(Native Method)
        at java.base/java.net.AbstractPlainSocketImpl.doConnect(AbstractPlainSocketImpl.java:399)
        at java.base/java.net.AbstractPlainSocketImpl.connectToAddress(AbstractPlainSocketImpl.java:242)
        at java.base/java.net.AbstractPlainSocketImpl.connect(AbstractPlainSocketImpl.java:224)
        at java.base/java.net.SocksSocketImpl.connect(SocksSocketImpl.java:403)
        at java.base/java.net.Socket.connect(Socket.java:609)
        at redis.clients.jedis.Connection.connect(Connection.java:184)
        ... 46 more

But when i do
bf.contains(Collections.singleton("testElement"))
It works exactly as expected;
Also i've checked any possible connectivity issues. all redis instances (master and slaves) are accessible from my machine.
Also it works just fine if i disable slaves and work with master alone.

Please help me resolve this issue; Any help is much appreciated !

@zhangb191
Copy link

i have the same problem,help!!

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