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

upgrade fireman to 2.0.24 #759

Merged
merged 3 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
</exclusion>
<exclusion>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
Expand Down Expand Up @@ -940,7 +944,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.1</version>
<version>2.22.2</version>
</plugin>


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,12 +115,11 @@ private void removeExpireData(Date currentTime) {
Iterator<Map.Entry<Date, Integer>> iterator = checkerIndexes.entrySet().iterator();
while (iterator.hasNext()) {
Map.Entry<Date, Integer> entry = iterator.next();
logger.warn("[removeExpireData] remove expire index:{} time:{}, expire time:{}", entry.getValue(), entry.getKey(), config.getKeeperCheckerIntervalMilli());
if (currentTime.getTime() - entry.getKey().getTime() > config.getKeeperCheckerIntervalMilli()) {
logger.info("[removeExpireData] remove expire index:{} time:{}, expire time:{}", entry.getValue(), entry.getKey(), config.getKeeperCheckerIntervalMilli());
allKeeperContainerUsedInfoModels.remove(entry.getValue());
iterator.remove();
}
break;
} else break;
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ctrip.xpipe.redis.console.service.impl;

import com.ctrip.xpipe.api.command.CommandFuture;
import com.ctrip.xpipe.api.foundation.FoundationService;
import com.ctrip.xpipe.cluster.ClusterType;
import com.ctrip.xpipe.command.AbstractCommand;
Expand Down Expand Up @@ -231,20 +232,23 @@

UnhealthyInfoModel infoAggregation = new UnhealthyInfoModel();
ParallelCommandChain commandChain = new ParallelCommandChain(executors);
Map<String, CommandFuture<UnhealthyInfoModel>> results = new HashMap<>();
for (String dcId : xpipeMeta.getDcs().keySet()) {
FetchDcUnhealthyInstanceCmd cmd = new FetchDcUnhealthyInstanceCmd(dcId);
commandChain.add(cmd);
cmd.future().addListener(commandFuture -> {
results.put(dcId, cmd.future());
}

try {
commandChain.execute().sync();
for (Map.Entry<String, CommandFuture<UnhealthyInfoModel>> result: results.entrySet()) {
CommandFuture<UnhealthyInfoModel> commandFuture = result.getValue();
if (commandFuture.isSuccess() && null != commandFuture.get()) {
infoAggregation.merge(commandFuture.get());
} else {
infoAggregation.getAttachFailDc().add(dcId);
infoAggregation.getAttachFailDc().add(result.getKey());

Check warning on line 249 in redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DefaultDelayService.java

View check run for this annotation

Codecov / codecov/patch

redis/redis-console/src/main/java/com/ctrip/xpipe/redis/console/service/impl/DefaultDelayService.java#L249

Added line #L249 was not covered by tests
}
});
}

try {
commandChain.execute().get();
}
} catch (Throwable th) {
logger.info("[getAllUnhealthyInstance][fail] {}", th.getMessage());
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.ctrip.xpipe.redis.console.keeper.impl;

import com.ctrip.xpipe.AbstractTest;
import com.ctrip.xpipe.api.foundation.FoundationService;
import com.ctrip.xpipe.redis.checker.model.DcClusterShard;
import com.ctrip.xpipe.redis.checker.model.KeeperContainerUsedInfoModel;
Expand Down Expand Up @@ -28,7 +29,7 @@
* 2023/9/20
*/
@RunWith(org.mockito.junit.MockitoJUnitRunner.class)
public class DefaultKeeperContainerUsedInfoAnalyzerTest {
public class DefaultKeeperContainerUsedInfoAnalyzerTest extends AbstractTest {

@InjectMocks
private DefaultKeeperContainerUsedInfoAnalyzer analyzer;
Expand Down Expand Up @@ -80,6 +81,8 @@ public void testUpdateKeeperContainerUsedInfo() {
model3.setDetailInfo(detailInfo3);
models2.add(model3);

// avoid calling updateKeeperContainerUsedInfo in the same milliSecond and fail case
sleep(1);
analyzer.updateKeeperContainerUsedInfo(1, models2);
Assert.assertEquals(0, analyzer.getCheckerIndexes().size());
Assert.assertEquals(0, analyzer.getAllKeeperContainerUsedInfoModels().size());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;

import java.util.LinkedList;
Expand Down Expand Up @@ -82,8 +83,8 @@ public void testSingleThreadProcess() throws Exception {
partialSuccessState.getStateActionState().tryAction();

waitConditionUntilTimeOut(() -> retryCnt.get() >= failCnt);
verify(migrationCluster).updateStat(isA(MigrationPublishState.class));
verify(migrationCluster).process();
verify(migrationCluster, Mockito.timeout(3000).times(1)).updateStat(isA(MigrationPublishState.class));
verify(migrationCluster, Mockito.timeout(3000).times(1)).process();
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,6 @@
FakeRedisRdbDumpLong.class,
RateLimitTest.class,
})
public class AllTests {
public class AllRateLimitTests {

}
Original file line number Diff line number Diff line change
Expand Up @@ -84,10 +84,8 @@ public void testBackupDcActiveKeeper_DrMigration_ShouldLimit() throws Exception
redisKeeperServer1.getRedisKeeperServerState().becomeActive(new DefaultEndPoint("127.0.0.1", redisKeeperServer2.getListeningPort()));

waitRedisKeeperServerConnected(redisKeeperServer1);
waitConditionUntilTimeOut(()->assertSuccess(()->{
verify(leakyBucket, times(1)).tryAcquire();
verify(leakyBucket, times(1)).release();
}));
verify(leakyBucket, timeout(5000).times(1)).tryAcquire();
verify(leakyBucket, timeout(5000).times(1)).release();
}


Expand Down
2 changes: 1 addition & 1 deletion services/ctrip-service/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
<dubbo.version>2.7.8</dubbo.version>
<fastjson.version>1.2.83</fastjson.version>
<qtracer.version>1.3.9</qtracer.version>
<fireman.version>2.0.16</fireman.version>
<fireman.version>2.0.24</fireman.version>
</properties>

<dependencyManagement>
Expand Down
Loading