|
|
@ -556,8 +556,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
public RFuture<RedisConnection> connectionWriteOp(NodeSource source, RedisCommand<?> command) {
|
|
|
|
public RFuture<RedisConnection> connectionWriteOp(NodeSource source, RedisCommand<?> command) {
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|
if (entry == null) {
|
|
|
|
if (entry == null) {
|
|
|
|
RedisNodeNotFoundException ex = new RedisNodeNotFoundException("Node: " + source + " hasn't been discovered yet");
|
|
|
|
return createNodeNotFoundFuture(source);
|
|
|
|
return RedissonPromise.newFailedFuture(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// fix for https://github.com/redisson/redisson/issues/1548
|
|
|
|
// fix for https://github.com/redisson/redisson/issues/1548
|
|
|
|
if (source.getRedirect() != null
|
|
|
|
if (source.getRedirect() != null
|
|
|
@ -587,8 +586,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
public RFuture<RedisConnection> connectionReadOp(NodeSource source, RedisCommand<?> command) {
|
|
|
|
public RFuture<RedisConnection> connectionReadOp(NodeSource source, RedisCommand<?> command) {
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|
if (entry == null) {
|
|
|
|
if (entry == null) {
|
|
|
|
RedisNodeNotFoundException ex = new RedisNodeNotFoundException("Node: " + source + " hasn't been discovered yet");
|
|
|
|
return createNodeNotFoundFuture(source);
|
|
|
|
return RedissonPromise.newFailedFuture(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (source.getRedirect() != null) {
|
|
|
|
if (source.getRedirect() != null) {
|
|
|
@ -601,6 +599,16 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
|
|
|
|
return entry.connectionReadOp(command);
|
|
|
|
return entry.connectionReadOp(command);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
protected RFuture<RedisConnection> createNodeNotFoundFuture(NodeSource source) {
|
|
|
|
|
|
|
|
RedisNodeNotFoundException ex;
|
|
|
|
|
|
|
|
if (source.getSlot() != null && source.getAddr() == null && source.getRedisClient() == null) {
|
|
|
|
|
|
|
|
ex = new RedisNodeNotFoundException("Node for slot: " + source.getSlot() + " hasn't been discovered yet. Check cluster slots coverage using CLUSTER NODES command");
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
ex = new RedisNodeNotFoundException("Node: " + source + " hasn't been discovered yet.");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return RedissonPromise.newFailedFuture(ex);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
@Override
|
|
|
|
public void releaseWrite(NodeSource source, RedisConnection connection) {
|
|
|
|
public void releaseWrite(NodeSource source, RedisConnection connection) {
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|
MasterSlaveEntry entry = getEntry(source);
|
|
|
|