Skip to content

Conversation

@roblg
Copy link
Contributor

@roblg roblg commented Mar 14, 2016

Hey all, this is my attempt at a fix for #1229. It sounded like the approach seemed reasonable, so I thought I'd take a stab at it.

Tests pass for me locally against the unstable branch of redis. I tried to add a new test for my specific case where equality check in HostAndPort fails, so multiple nodes end up in the list, but there's already code to convert 127.0.0.1 --> localhost in HostAndPort, so it wasn't clear how I'd be able to test my particular situation safely in many different test environments.

I based my fix on the 2.8 branch, but I can switch it to the 2.9 or master branches if that makes more sense.

Thanks for considering!

nykolaslima and others added 30 commits February 10, 2015 12:00
Revert "Add test for JedistCluster's method blpop"

This reverts commit f705810.
* Fixes redis#896
* Renaming a key to itself is now essentially a noop
…ior-of-rename

Follow up new behavior of rename from test
Deprecates psetex(String, int, String) in favour of
psetex(String, long, String).
Removes deprecated psetex(String, int, String).
…aram

Remove deprecated PSETEX with int parameter
…-from-jediscluster

Deprecate BasicCommands from JedisCluster since it has no meaning
…scan-in-jediscluster

Fix: slot key is missed from *scan in JedisCluster
…-cluster

deprecating blpop and brpop that will be removed in 3.0.0
* checks that Jedis marks broken status properly while running scriptExists
…reply-does-not-mark-broken

fix bug: getIntegerMultiBulkReply() doesn't handle broken status
To improve usability we're changing the visibility of `returnResoure`
and `returnBrokenResource` in favor of `jedis.close()` which
automatically returns the resource to the pool accordingly.
As `Pool` and `Jedis` are currently in different packages i've created
a JedisPoolAbstract class to provide a bridge between the two
implementations
@marcosnils
Copy link
Contributor

@roblg thanks for submitting a patch. I believe it's heading in the proper direction. In order to test this you might try to setup JedisCluster like this:

    Set<HostAndPort> jedisClusterNode = new HashSet<HostAndPort>();
    jedisClusterNode.add(new HostAndPort("localhost", 7379));
    jedisClusterNode.add(new HostAndPort("some_other_host", 7379));
    JedisCluster jc = new JedisCluster(jedisClusterNode);
    // Assert on jc.getClusterNodes().size()

With the previous code JedisCluster will populate all the hosts in the cluster plus "some_other_host" (even though it's invalid). Your test needs to assert that supplied hosts are not added into the node list.

@roblg roblg force-pushed the no-seed-nodes-in-node-list branch from fb48f8a to 00ad991 Compare March 14, 2016 05:06
@roblg
Copy link
Contributor Author

roblg commented Mar 14, 2016

@marcosnils good call. I realized while I was writing the "invalid host" test that I was mistaken about how the 127 vs. localhost equality was happening. I actually got the "broken" behavior if I created a new HostAndPort("localhost", 7379), so I included a test for that as well.

PR updated.

@marcosnils marcosnils added this to the 2.9.0 milestone Mar 14, 2016
@marcosnils
Copy link
Contributor

@roblg LGTM. I'd like @HeartSaVioR or @xetorthio to review before merging.

I'd also like to schedule this for 2.9 as it changes the way JedisCluster is initializing. Even though I believe it "shouldn't" cause any problems, I propose to move it to a minor release just in case

@HeartSaVioR
Copy link
Contributor

@roblg
LGTM. Thanks for the work!
Btw, it would be more sense to move to master branch. We can take care of backporting if necessary.

@roblg
Copy link
Contributor Author

roblg commented Mar 14, 2016

@HeartSaVioR @marcosnils would you like me to update the PR to be based on master?

@marcosnils
Copy link
Contributor

@roblg yes please. We'll take care to downmerge to 2.9

@HeartSaVioR
Copy link
Contributor

Yes, if you don't mind. Thanks in advance!

@HeartSaVioR
Copy link
Contributor

@marcosnils You're really fast! lol

@marcosnils
Copy link
Contributor

@HeartSaVioR 👅 going to bed. Can you please merge once changes are made?. Thx!.

@roblg roblg force-pushed the no-seed-nodes-in-node-list branch from 00ad991 to 7366fc1 Compare March 14, 2016 05:24
@roblg roblg closed this Mar 14, 2016
@HeartSaVioR
Copy link
Contributor

@roblg Ah, one thing we didn't say... PR should be re-created against master. It's a limitation of Github PR.

@roblg
Copy link
Contributor Author

roblg commented Mar 14, 2016

@HeartSaVioR yeah that kind of surprised me. I've been using Bitbucket at work for several years. Got it sorted out though (I hope).

@HeartSaVioR HeartSaVioR removed this from the 2.9.0 milestone Jul 22, 2016
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

Successfully merging this pull request may close these issues.