Skip to content
This repository was archived by the owner on Mar 31, 2023. It is now read-only.

Commit d6ed075

Browse files
author
Liguang Xie
committed
Fix Ip mgr ignite misconfiguration
1 parent 85de8fb commit d6ed075

2 files changed

Lines changed: 40 additions & 3 deletions

File tree

kubernetes/services/ignite_ip_config.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,42 @@ Copyright(c) 2020 Futurewei Cloud
3838
</bean>
3939
</property>
4040
<property name="storagePath" value="/opt/ip"/>
41+
<property name="walPath" value="/db/wal"/>
42+
<property name="walArchivePath" value="/db/wal/archive"/>
4143
</bean>
4244
</property>
4345

46+
<property name="cacheConfiguration">
47+
<list>
48+
<bean class="org.apache.ignite.configuration.CacheConfiguration">
49+
<!-- Set the cache name. -->
50+
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrAlloc"/>
51+
<!-- Set the cache mode. -->
52+
<property name="atomicityMode" value="TRANSACTIONAL"/>
53+
<!-- Other cache parameters. -->
54+
<property name="cacheMode" value="PARTITIONED"/>
55+
</bean>
56+
57+
<bean class="org.apache.ignite.configuration.CacheConfiguration">
58+
<!-- Set the cache name. -->
59+
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.IpAddrRange"/>
60+
<!-- Set the cache mode. -->
61+
<property name="atomicityMode" value="TRANSACTIONAL"/>
62+
<!-- Other cache parameters. -->
63+
<property name="cacheMode" value="PARTITIONED"/>
64+
</bean>
65+
66+
<bean class="org.apache.ignite.configuration.CacheConfiguration">
67+
<!-- Set the cache name. -->
68+
<property name="name" value="com.futurewei.alcor.privateipmanager.entity.VpcIpRange"/>
69+
<!-- Set the cache mode. -->
70+
<property name="atomicityMode" value="TRANSACTIONAL"/>
71+
<!-- Other cache parameters. -->
72+
<property name="cacheMode" value="PARTITIONED"/>
73+
</bean>
74+
</list>
75+
</property>
76+
4477
<!-- Explicitly configure TCP discovery SPI to provide list of initial nodes. -->
4578
<property name="discoverySpi">
4679
<bean class="org.apache.ignite.spi.discovery.tcp.TcpDiscoverySpi">

services/subnet_manager/src/main/java/com/futurewei/alcor/subnet/controller/SubnetController.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,12 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
243243
// Synchronous blocking
244244
CompletableFuture<Void> allFuture = CompletableFuture.allOf(vpcFuture, ipFuture);
245245
allFuture.join();
246+
VpcWebJson vpcResponse = vpcFuture.join();
247+
String ipRangeId = ipFuture.join();
246248

247-
logger.info("Total processing time:" + (System.currentTimeMillis() - start) + "ms");
249+
logger.info("[createSubnetState] Verified VPC id:" + vpcResponse.toString());
250+
logger.info("[createSubnetState] Allocated ip range:" + ipRangeId);
251+
logger.info("[createSubnetState] Time to verify VPC id and allocate ip range:" + (System.currentTimeMillis() - start) + "ms");
248252

249253
this.subnetDatabaseService.addSubnet(inSubnetEntity);
250254

@@ -270,10 +274,10 @@ public SubnetWebJson createSubnetState(@PathVariable String projectId, @RequestB
270274
}
271275

272276
if (Ipv4AddrUtil.formatCheck(gatewayIp)) {
273-
inSubnetEntity.setIpV4RangeId(ipFuture.join());
277+
inSubnetEntity.setIpV4RangeId(ipRangeId);
274278
inSubnetEntity.setIpVersion(4);
275279
} else {
276-
inSubnetEntity.setIpV6RangeId(ipFuture.join());
280+
inSubnetEntity.setIpV6RangeId(ipRangeId);
277281
inSubnetEntity.setIpVersion(6);
278282
}
279283

0 commit comments

Comments
 (0)