diff --git a/configuration/on-site-scripts/aws-cli-base b/configuration/on-site-scripts/aws-cli-base deleted file mode 100755 index 4936b6d0bbb..00000000000 --- a/configuration/on-site-scripts/aws-cli-base +++ /dev/null @@ -1,8 +0,0 @@ -#!/bin/bash -# Discover replicas -IPs="" -for i in $( cat `dirname $0`/regions.txt ); do - echo Region: $i >&2 - IPs="${IPs} $( aws --region $i ec2 describe-instances --filters Name=tag:sailing-analytics-server,Values=tokyo2020 | jq .Reservations[].Instances[].PublicIpAddress -r )" -done -echo "${IPs}" diff --git a/configuration/on-site-scripts/get-replica-ips b/configuration/on-site-scripts/get-replica-ips index 4936b6d0bbb..a2eda30eac2 100755 --- a/configuration/on-site-scripts/get-replica-ips +++ b/configuration/on-site-scripts/get-replica-ips @@ -3,6 +3,6 @@ IPs="" for i in $( cat `dirname $0`/regions.txt ); do echo Region: $i >&2 - IPs="${IPs} $( aws --region $i ec2 describe-instances --filters Name=tag:sailing-analytics-server,Values=tokyo2020 | jq .Reservations[].Instances[].PublicIpAddress -r )" + IPs="${IPs} $( aws --region $i ec2 describe-instances --filters Name=instance-state-name,Values=running Name=tag:sailing-analytics-server,Values=tokyo2020 | jq .Reservations[].Instances[].PublicIpAddress -r )" done echo "${IPs}" diff --git a/configuration/on-site-scripts/launch-replicas-in-all-regions.sh b/configuration/on-site-scripts/launch-replicas-in-all-regions.sh index 062f2994582..108229e6657 100755 --- a/configuration/on-site-scripts/launch-replicas-in-all-regions.sh +++ b/configuration/on-site-scripts/launch-replicas-in-all-regions.sh @@ -6,14 +6,14 @@ if [ $# -eq 0 ]; then echo "" echo "-b replication bearer token; mandatory" echo "-i Amazon Machine Image (AMI) ID to use to launch the instance; defaults to latest image tagged with image-type:sailing-analytics-server" - echo "-k Key pair name, mapping to the --key-name parameter" + echo "-k Key pair name, mapping to the --key-name parameter; defaults to Axel" echo "-R release name; must be provided to select the release, e.g., build-202106040947" echo "-t Instance type; defaults to ${INSTANCE_TYPE}" echo echo "Example: $0 -b 098toyw098typ9e8/87t9shytp98894y5= -R build-202106041327 -k Jan" echo echo "Will launch as many new replicas in regions $( cat `dirname $0`/regions.txt ) with the release specified with -R" - echo "as there are currently healthy auto-replicas registered with teh S-ded-tokyo2020 target group in the region (at least one)." + echo "as there are currently healthy auto-replicas registered with the S-ded-tokyo2020 target group in the region (at least one)" echo "which will register at the master proxy tokyo-ssh.internal.sapsailing.com:8888 and RabbitMQ at" echo "rabbit-ap-northeast-1.sapsailing.com:5672, then when healthy get added to target group S-ded-tokyo2020" echo "in that region, with all auto-replicas registered before removed from the target group." diff --git a/configuration/on-site-scripts/launch-replicas-in-region.sh b/configuration/on-site-scripts/launch-replicas-in-region.sh index 0d95a6838cc..51018ad4b7a 100755 --- a/configuration/on-site-scripts/launch-replicas-in-region.sh +++ b/configuration/on-site-scripts/launch-replicas-in-region.sh @@ -14,9 +14,9 @@ if [ $# -eq 0 ]; then echo "-c Count; defaults to ${COUNT}" echo "-i Amazon Machine Image (AMI) ID to use to launch the instance; defaults to latest image tagged with image-type:sailing-analytics-server" echo "-g AWS Region, e.g., eu-west-1" - echo "-k Key pair name, mapping to the --key-name parameter" - echo "-p Primary host:port; defaults to ${REPLICA_SET_PRIMARY}" - echo "-r Replica set name; defaults to ${REPLICA_SET_NAME}" + echo "-k SSH key pair name, mapping to the --key-name parameter; defaults to Axel" + echo "-p MongoDB primary host[:port]; defaults to ${REPLICA_SET_PRIMARY}" + echo "-r MongoDB replica set name; defaults to ${REPLICA_SET_NAME}" echo "-R release name; must be provided to select the release, e.g., build-202106040947" echo "-t Instance type; defaults to ${INSTANCE_TYPE}" echo "-v VPC name; defaults to ${VPC}" diff --git a/configuration/on-site-scripts/stop-all-cloud-replicas.sh b/configuration/on-site-scripts/stop-all-cloud-replicas.sh index 149b7e4dc4d..f0c75b283ad 100755 --- a/configuration/on-site-scripts/stop-all-cloud-replicas.sh +++ b/configuration/on-site-scripts/stop-all-cloud-replicas.sh @@ -5,6 +5,11 @@ if [ $# -eq 0 ]; then echo "-b replication bearer token; mandatory" echo echo "Example: $0 -b 7345983275087320/59870hfly945=" + echo + echo "Will tell all replicas in the cloud to stop replicating. This works by invoking the" + echo "get-replica-ips script and for each of them to stop replicating, using the stopReplicating.sh" + echo "script in their /home/sailing/servers/tokyo2020 directory, passing through the bearer token." + echo "Note: this will NOT stop replication on the local replica on sap-p1-2!" exit 2 fi options='b:' diff --git a/configuration/on-site-scripts/update-launch-configuration.sh b/configuration/on-site-scripts/update-launch-configuration.sh index 395a085b6b5..dca569ec175 100755 --- a/configuration/on-site-scripts/update-launch-configuration.sh +++ b/configuration/on-site-scripts/update-launch-configuration.sh @@ -16,7 +16,7 @@ if [ $# -eq 0 ]; then echo "Will upgrade the auto-scaling group tokyo2020-* in the regions from regions.txt with a new" echo "launch configuration that will be derived from the existing launch configuration named tokyo2020-*" echo "by copying it to tokyo2020-{RELEASE_NAME} while updating the INSTALL_FROM_RELEASE parameter in the" - echo "user data to the {RELEASE_NAME}, and optionally adjuting the AMI, key pair name and instance type if specified." + echo "user data to the {RELEASE_NAME}, and optionally adjusting the AMI, key pair name and instance type if specified." echo "Note: this will NOT terminate any instances in the target group!" exit 2 fi diff --git a/configuration/on-site-scripts/upgrade-landscape.sh b/configuration/on-site-scripts/upgrade-landscape.sh index da90fe3ae22..23f1f398ec4 100755 --- a/configuration/on-site-scripts/upgrade-landscape.sh +++ b/configuration/on-site-scripts/upgrade-landscape.sh @@ -28,12 +28,21 @@ if [ $# -eq 0 ]; then echo "-s Skip release download" echo echo "Example: $0 -R build-202106041327 -k Jan" - echo - echo "Will upgrade the auto-scaling group tokyo2020-* in the regions from regions.txt with a new" - echo "launch configuration that will be derived from the existing launch configuration named tokyo2020-*" - echo "by copying it to tokyo2020-{RELEASE_NAME} while updating the INSTALL_FROM_RELEASE parameter in the" - echo "user data to the {RELEASE_NAME}, and optionally adjuting the AMI, key pair name and instance type if specified." - echo "Note: this will NOT terminate any instances in the target group!" + + echo "The procedure works in the following steps:" + echo " - patch *.conf files in sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[replica|master|security_service] so" + echo " their INSTALL_FROM_RELEASE points to the new ${RELEASE}" + echo " - Install new releases to sap-p1-1:servers/[master|security_service] and sap-p1-2:servers/[replica|master|security_service]" + echo " - Update all launch configurations and auto-scaling groups in the cloud (update-launch-configuration.sh)" + echo " - Tell all replicas in the cloud to stop replicating (stop-all-cloud-replicas.sh)" + echo " - Tell sap-p1-2 to stop replicating" + echo " - on sap-p1-1:servers/master run ./stop; ./start to bring the master to the new release" + echo " - wait until master is healthy" + echo " - on sap-p1-2:servers/replica run ./stop; ./start to bring up on-site replica again" + echo " - launch upgraded cloud replicas and replace old replicas in target group (launch-replicas-in-all-regions.sh)" + echo " - terminate all instances named \"SL Tokyo2020 (auto-replica)\"; this should cause the auto-scaling group to launch new instances as required" + echo " - manually inspect the health of everything and terminate the \"SL Tokyo2020 (Upgrade Replica)\" instances when enough new instances" + echo " named \"SL Tokyo2020 (auto-replica)\" are available" exit 2 fi options='R:b:t:i:k:s' diff --git a/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/impl/FixFactory.java b/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/impl/FixFactory.java index bfb0048afe6..600bf6d46f7 100755 --- a/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/impl/FixFactory.java +++ b/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/impl/FixFactory.java @@ -57,9 +57,11 @@ public class FixFactory { : Long.valueOf(fixTypeAndOptionalColonSeparatedSensorsSubId[1])); final Type ft = Type.valueOf(fixType); if (ft != null) { - Fix fix = createFix(sensor, ft, timePoint, valuesPerSubindex); - result.add(fix); - fixIndex++; + final Fix fix = createFix(sensor, ft, timePoint, valuesPerSubindex); + if (fix != null) { + result.add(fix); + fixIndex++; + } } } } @@ -67,14 +69,20 @@ public class FixFactory { return result; } + /** + * @return {@code null} in case the fix parser cannot make sense of the {@code valuesPerSubindex}, e.g., because + * it's empty. + */ private Fix createFix(Sensor sensor, Type fixType, TimePoint timePoint, Map valuesPerSubindex) { try { Constructor constructor = fixType.getFixClass().getConstructor(TimePoint.class, Sensor.class, Map.class); Fix fix = constructor.newInstance(timePoint, sensor, valuesPerSubindex); return fix; } catch (NoSuchMethodException | SecurityException | InstantiationException | IllegalAccessException | IllegalArgumentException | InvocationTargetException e) { - logger.log(Level.SEVERE, "Internal error trying to find fix constructor for fix type "+fixType+" with class "+fixType.getFixClass()); - throw new RuntimeException(e); + logger.log(Level.SEVERE, "Internal error trying to find fix constructor for fix type "+ + fixType+" with class "+fixType.getFixClass()+" or problem creating fix from data "+valuesPerSubindex+": "+ + e.getMessage()); + return null; } } } diff --git a/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/websocket/WebSocketConnectionManager.java b/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/websocket/WebSocketConnectionManager.java index b4269cbe979..742a72351c8 100755 --- a/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/websocket/WebSocketConnectionManager.java +++ b/java/com.sap.sailing.domain.igtimiadapter/src/com/sap/sailing/domain/igtimiadapter/websocket/WebSocketConnectionManager.java @@ -33,6 +33,18 @@ import com.sap.sse.common.Util; import com.sap.sse.common.impl.MillisecondsTimePoint; public class WebSocketConnectionManager implements LiveDataConnection { + /** + * The heartbeat receive timeout. Currently 45s because according to Brent Russel (2021-07-21) the server + * is expected to send every 15s, so we have a factor of two as tolerance. + */ + private static final long TIMEOUT_AFTER_NOT_RECEIVING_HEARTBEAT_IN_MILLIS = 45000l; + + /** + * Send ping message every 15s. The server will timeout if not receiving a heartbeat after 30s, so we have a tolerance + * of a factor of two, in other words allowing the heartbeat to travel for another 15s. + */ + private static final long DURATION_BETWEEN_HEARTBEAT_SENDS_IN_MILLIS = 15000l; + private static final Logger logger = Logger.getLogger(WebSocketConnectionManager.class.getName()); private final IgtimiConnectionFactoryImpl connectionFactory; private static enum TargetState { OPEN, CLOSED }; @@ -263,7 +275,7 @@ public class WebSocketConnectionManager implements LiveDataConnection { logger.log(Level.WARNING, "Error with server heartbeat in "+this, e); } } - }, /* wait for 45s for first execution */ 45000l, /* and check again every 45s*/ 45000l); + }, TIMEOUT_AFTER_NOT_RECEIVING_HEARTBEAT_IN_MILLIS, TIMEOUT_AFTER_NOT_RECEIVING_HEARTBEAT_IN_MILLIS); } private void startClientHeartbeat() { @@ -279,7 +291,7 @@ public class WebSocketConnectionManager implements LiveDataConnection { logger.log(Level.WARNING, "Couldn't send heartbeat to Igtimi web socket session in "+WebSocketConnectionManager.this+". Will continue to try...", e); } } - }, /* delay */ 0, /* send ping message every other minute; has to be at least every five minutes, so this should be safe */ 120000l); + }, /* delay */ 0, DURATION_BETWEEN_HEARTBEAT_SENDS_IN_MILLIS); } private synchronized void reconnect() throws Exception { diff --git a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CountryCodeTest.java b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CountryCodeTest.java index 43cbe7de298..7a8824e16dc 100755 --- a/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CountryCodeTest.java +++ b/java/com.sap.sailing.domain.test/src/com/sap/sailing/domain/test/CountryCodeTest.java @@ -24,7 +24,7 @@ import com.sap.sse.common.CountryCodeFactory; import com.sap.sse.common.Util; public class CountryCodeTest { - private static final int NUMBER_OF_COUNTRY_CODES = 259; + private static final int NUMBER_OF_COUNTRY_CODES = 260; @Ignore @Test diff --git a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/whatsnew/resources/SailingAnalyticsNotes.html b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/whatsnew/resources/SailingAnalyticsNotes.html index bb8f49537fd..2a20497134a 100755 --- a/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/whatsnew/resources/SailingAnalyticsNotes.html +++ b/java/com.sap.sailing.gwt.ui/src/main/java/com/sap/sailing/gwt/home/desktop/places/whatsnew/resources/SailingAnalyticsNotes.html @@ -14,6 +14,8 @@
  • Groups are now ordered by name in the drop-down for setting the default creation group under "User Details."
  • A Slovenian translation of the user interface has been added.
  • +
  • The IOC code for "Russian Olympic Committee" has been added under the "ROC" abbreviation, together + with the IOC-provided flag.
  • June 2021

    June 2021