Merge branch 'master' into 3.0.0

pull/1821/head
Nikita 7 years ago
commit 3754d65826

@ -17,13 +17,13 @@ Usage
<dependency> <dependency>
<groupId>org.redisson</groupId> <groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId> <artifactId>redisson-spring-boot-starter</artifactId>
<version>3.8.0</version> <version>3.8.1</version>
</dependency> </dependency>
``` ```
Gradle Gradle
```java ```java
compile 'org.redisson:redisson-spring-boot-starter:3.8.0' compile 'org.redisson:redisson-spring-boot-starter:3.8.1'
``` ```
2. __For JDK 1.6+__ 2. __For JDK 1.6+__
@ -33,13 +33,13 @@ Usage
<dependency> <dependency>
<groupId>org.redisson</groupId> <groupId>org.redisson</groupId>
<artifactId>redisson-spring-boot-starter</artifactId> <artifactId>redisson-spring-boot-starter</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
</dependency> </dependency>
``` ```
Gradle Gradle
```java ```java
compile 'org.redisson:redisson-spring-boot-starter:2.13.0' compile 'org.redisson:redisson-spring-boot-starter:2.13.1'
``` ```
### 2. Add settings into `application.settings` file ### 2. Add settings into `application.settings` file

@ -24,20 +24,20 @@ Usage
<artifactId>redisson-spring-data-18</artifactId> <artifactId>redisson-spring-data-18</artifactId>
<!-- for Spring Data Redis v.2.0.x --> <!-- for Spring Data Redis v.2.0.x -->
<artifactId>redisson-spring-data-20</artifactId> <artifactId>redisson-spring-data-20</artifactId>
<version>3.8.0</version> <version>3.8.1</version>
</dependency> </dependency>
``` ```
Gradle Gradle
```java ```java
// for Spring Data Redis v.1.6.x // for Spring Data Redis v.1.6.x
compile 'org.redisson:redisson-spring-data-16:3.8.0' compile 'org.redisson:redisson-spring-data-16:3.8.1'
// for Spring Data Redis v.1.7.x // for Spring Data Redis v.1.7.x
compile 'org.redisson:redisson-spring-data-17:3.8.0' compile 'org.redisson:redisson-spring-data-17:3.8.1'
// for Spring Data Redis v.1.8.x // for Spring Data Redis v.1.8.x
compile 'org.redisson:redisson-spring-data-18:3.8.0' compile 'org.redisson:redisson-spring-data-18:3.8.1'
// for Spring Data Redis v.2.0.x // for Spring Data Redis v.2.0.x
compile 'org.redisson:redisson-spring-data-20:3.8.0' compile 'org.redisson:redisson-spring-data-20:3.8.1'
``` ```
2. __For JDK 1.6+__ 2. __For JDK 1.6+__
@ -54,20 +54,20 @@ Usage
<artifactId>redisson-spring-data-18</artifactId> <artifactId>redisson-spring-data-18</artifactId>
<!-- for Spring Data Redis v.2.0.x --> <!-- for Spring Data Redis v.2.0.x -->
<artifactId>redisson-spring-data-20</artifactId> <artifactId>redisson-spring-data-20</artifactId>
<version>2.13.0</version> <version>2.13.1</version>
</dependency> </dependency>
``` ```
Gradle Gradle
```java ```java
// for Spring Data Redis v.1.6.x // for Spring Data Redis v.1.6.x
compile 'org.redisson:redisson-spring-data-16:2.13.0' compile 'org.redisson:redisson-spring-data-16:2.13.1'
// for Spring Data Redis v.1.7.x // for Spring Data Redis v.1.7.x
compile 'org.redisson:redisson-spring-data-17:2.13.0' compile 'org.redisson:redisson-spring-data-17:2.13.1'
// for Spring Data Redis v.1.8.x // for Spring Data Redis v.1.8.x
compile 'org.redisson:redisson-spring-data-18:2.13.0' compile 'org.redisson:redisson-spring-data-18:2.13.1'
// for Spring Data Redis v.2.0.x // for Spring Data Redis v.2.0.x
compile 'org.redisson:redisson-spring-data-20:2.13.0' compile 'org.redisson:redisson-spring-data-20:2.13.1'
``` ```

@ -58,25 +58,25 @@ Usage
**2** Copy two jars into `TOMCAT_BASE/lib` directory: **2** Copy two jars into `TOMCAT_BASE/lib` directory:
1. __For JDK 1.8+__ 1. __For JDK 1.8+__
[redisson-all-3.7.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.7.5&e=jar) [redisson-all-3.8.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=3.8.1&e=jar)
for Tomcat 6.x for Tomcat 6.x
[redisson-tomcat-6-3.7.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=3.7.5&e=jar) [redisson-tomcat-6-3.8.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=3.8.1&e=jar)
for Tomcat 7.x for Tomcat 7.x
[redisson-tomcat-7-3.7.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=3.7.5&e=jar) [redisson-tomcat-7-3.8.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=3.8.1&e=jar)
for Tomcat 8.x for Tomcat 8.x
[redisson-tomcat-8-3.7.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=3.7.5&e=jar) [redisson-tomcat-8-3.8.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=3.8.1&e=jar)
for Tomcat 9.x for Tomcat 9.x
[redisson-tomcat-9-3.7.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-9&v=3.7.5&e=jar) [redisson-tomcat-9-3.8.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-9&v=3.8.1&e=jar)
2. __For JDK 1.6+__ 2. __For JDK 1.6+__
[redisson-all-2.12.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=2.12.5&e=jar) [redisson-all-2.13.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-all&v=2.13.1&e=jar)
for Tomcat 6.x for Tomcat 6.x
[redisson-tomcat-6-2.12.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=2.12.5&e=jar) [redisson-tomcat-6-2.13.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-6&v=2.13.1&e=jar)
for Tomcat 7.x for Tomcat 7.x
[redisson-tomcat-7-2.12.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=2.12.5&e=jar) [redisson-tomcat-7-2.13.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-7&v=2.13.1&e=jar)
for Tomcat 8.x for Tomcat 8.x
[redisson-tomcat-8-2.12.5.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=2.12.5&e=jar) [redisson-tomcat-8-2.13.1.jar](https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=org.redisson&a=redisson-tomcat-8&v=2.13.1&e=jar)

@ -78,7 +78,7 @@ public class CommandsQueue extends ChannelDuplexHandler {
} }
command.getChannelPromise().tryFailure( command.getChannelPromise().tryFailure(
new WriteRedisConnectionException("Can't write command: " + command.getCommand() + " to channel: " + ctx.channel())); new WriteRedisConnectionException("Channel has been closed! Can't write command: " + command.getCommand() + " to channel: " + ctx.channel()));
} }
super.channelInactive(ctx); super.channelInactive(ctx);

@ -507,7 +507,7 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
Set<ClusterPartition> lastPartitions = getLastPartitions(); Set<ClusterPartition> lastPartitions = getLastPartitions();
for (final ClusterPartition newPart : newPartitions) { for (final ClusterPartition newPart : newPartitions) {
boolean masterFound = false; boolean masterFound = false;
for (ClusterPartition currentPart : lastPartitions) { for (final ClusterPartition currentPart : lastPartitions) {
if (!newPart.getMasterAddress().equals(currentPart.getMasterAddress())) { if (!newPart.getMasterAddress().equals(currentPart.getMasterAddress())) {
continue; continue;
} }
@ -521,11 +521,19 @@ public class ClusterConnectionManager extends MasterSlaveConnectionManager {
// does partition has a new master? // does partition has a new master?
if (!newMasterPart.getMasterAddress().equals(currentPart.getMasterAddress())) { if (!newMasterPart.getMasterAddress().equals(currentPart.getMasterAddress())) {
URI newUri = newMasterPart.getMasterAddress(); URI newUri = newMasterPart.getMasterAddress();
URI oldUri = currentPart.getMasterAddress(); final URI oldUri = currentPart.getMasterAddress();
changeMaster(slot, newUri); RFuture<RedisClient> future = changeMaster(slot, newUri);
future.addListener(new FutureListener<RedisClient>() {
@Override
public void operationComplete(Future<RedisClient> future) throws Exception {
if (!future.isSuccess()) {
currentPart.setMasterAddress(oldUri);
}
}
});
currentPart.setMasterAddress(newMasterPart.getMasterAddress()); currentPart.setMasterAddress(newUri);
} }
} }
break; break;

@ -504,10 +504,11 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
return slot2entry.get(slot); return slot2entry.get(slot);
} }
protected final void changeMaster(int slot, URI address) { protected final RFuture<RedisClient> changeMaster(int slot, URI address) {
final MasterSlaveEntry entry = getEntry(slot); final MasterSlaveEntry entry = getEntry(slot);
final RedisClient oldClient = entry.getClient(); final RedisClient oldClient = entry.getClient();
entry.changeMaster(address).addListener(new FutureListener<RedisClient>() { RFuture<RedisClient> future = entry.changeMaster(address);
future.addListener(new FutureListener<RedisClient>() {
@Override @Override
public void operationComplete(Future<RedisClient> future) throws Exception { public void operationComplete(Future<RedisClient> future) throws Exception {
if (future.isSuccess()) { if (future.isSuccess()) {
@ -516,6 +517,7 @@ public class MasterSlaveConnectionManager implements ConnectionManager {
} }
} }
}); });
return future;
} }
protected final void addEntry(Integer slot, MasterSlaveEntry entry) { protected final void addEntry(Integer slot, MasterSlaveEntry entry) {

@ -422,7 +422,7 @@ public class MasterSlaveEntry {
@Override @Override
public void operationComplete(Future<RedisClient> future) throws Exception { public void operationComplete(Future<RedisClient> future) throws Exception {
if (!future.isSuccess()) { if (!future.isSuccess()) {
log.error("Can't change master to: {}", address); log.error("Unable to change master from: " + oldMaster.getClient().getAddr() + " to: " + address, future.cause());
return; return;
} }

Loading…
Cancel
Save