Skip to content

Commit

Permalink
support skip ror rdb
Browse files Browse the repository at this point in the history
  • Loading branch information
hailu committed Dec 9, 2024
1 parent ae59b36 commit fc044ec
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ public class DefaultKeeperConfig extends AbstractCoreConfig implements KeeperCon
private static String KEY_CROSS_REGION_MAX_FSYNC_SLAVES = "crossregion.replication.loading.slaves.max";

private static String KEY_FSYNC_RATE_LIMIT = "keeper.repl.fsync.rate.limit";
private static String KEY_TRY_ROR_RDB = "keeper.try.ror.rdb";

public DefaultKeeperConfig(){

Expand Down Expand Up @@ -195,4 +196,9 @@ public int getCrossRegionMaxLoadingSlavesCnt() {
public boolean fsyncRateLimit() {
return getBooleanProperty(KEY_FSYNC_RATE_LIMIT, true);
}

@Override
public boolean tryRorRdb() {
return getBooleanProperty(KEY_TRY_ROR_RDB, true);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -74,4 +74,6 @@ public interface KeeperConfig extends CoreConfig{

boolean fsyncRateLimit();

boolean tryRorRdb();

}
Original file line number Diff line number Diff line change
Expand Up @@ -274,4 +274,9 @@ public int getApplierReadIdleSeconds() {
public boolean fsyncRateLimit() {
return true;
}

@Override
public boolean tryRorRdb() {
return true;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ private RedisKeeperServer doAdd(KeeperTransMeta keeperTransMeta, KeeperMeta keep

private void enrichKeeperMetaFromKeeperTransMeta(KeeperMeta keeperMeta, KeeperTransMeta keeperTransMeta) {
ClusterMeta clusterMeta = new ClusterMeta().setDbId(keeperTransMeta.getClusterDbId());
clusterMeta.setDbId(keeperTransMeta.getClusterDbId());
ShardMeta shardMeta = new ShardMeta().setDbId(keeperTransMeta.getShardDbId());
shardMeta.setDbId(keeperTransMeta.getShardDbId());
shardMeta.setParent(clusterMeta);
keeperMeta.setParent(shardMeta);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public DefaultRedisMasterReplication(RedisMaster redisMaster, RedisKeeperServer
public boolean tryRordb() {
// capa rordb as default
// if the master support rordb, the slaves will most likely support it too
return true;
return this.redisKeeperServer.getKeeperConfig().tryRorRdb();
}

@Override
Expand Down

0 comments on commit fc044ec

Please sign in to comment.