mirror of
https://github.com/floci-io/floci.git
synced 2026-12-06 11:38:06 -05:00
fix(kinesisanalytics): start Flink clusters again when Floci restarts (#9390)
Floci's shutdown removes every application's Flink cluster, and nothing started them again, so after a restart with persistent storage an application still reported RUNNING with no cluster and no job behind it. At startup, each application that was RUNNING or still STARTING goes back to STARTING, and its cluster starts in the background. A cluster that outlived Floci is kept when its JobManager, TaskManager and job still run. Otherwise what survives of it is removed, under the current or the old floci- names, and the application gets a new cluster, as StartApplication starts one, in the application's own account, and the readiness poller runs its job afresh and reports it RUNNING. An application whose cluster cannot be started goes back to READY, from which StartApplication starts it again. An application stopped while its restore is starting the cluster is STOPPING, as AWS reports a stop in progress, until the restore has removed that cluster by its containers' IDs, and READY then. StartApplication and DeleteApplication refuse it meanwhile, so no second start runs under the cluster's names. One still STOPPING at the next start has what survives of its cluster removed before it turns READY. Each removal is confirmed with Docker: while Docker keeps the cluster, the application stays STOPPING and the cluster stays named and tracked, for shutdown and the next start. Records stored under the keys of older builds move onto their current keys first, so no application is restored twice. A start that shutdown overtakes removes its containers. Part of #5664.
This commit is contained in:
1 parent
874c3d6123
commit
732001a90f
11 files changed
+1480
-52
No files matched your search
@@ -240,6 +240,14 @@ grep -q '/eks/' "$SHARD_FILE" && [ -n "$K3S_IMAGE" ] && pull "$K3S_IMAGE"
|
||||
# pinned in application.yml too.
|
||||
RABBITMQ_IMAGE="$(grep -oE 'default-image: *"rabbitmq:[^"]+"' src/main/resources/application.yml | grep -oE '"[^"]+"' | tr -d '"')"
|
||||
starts AmazonMqBrokerRestartNightlyIntegrationTest && [ -n "$RABBITMQ_IMAGE" ] && pull "$RABBITMQ_IMAGE"
|
||||
# The nightly KinesisAnalyticsFlinkRestartNightlyIntegrationTest runs a FLINK-1_20 application, whose image
|
||||
# KinesisAnalyticsRuntimes maps, and the EFS init image chowns its savepoints volume.
|
||||
FLINK_IMAGE="$(grep -oE '"FLINK-1_20", *"[^"]+"' "$(find src/main/java -name KinesisAnalyticsRuntimes.java -print -quit)" | grep -oE '"apache/flink:[^"]+"' | tr -d '"')"
|
||||
EFS_INIT_IMAGE="$(grep -oE '^ +init-image: *[^ #]+' src/main/resources/application.yml | head -n 1 | sed 's/.*init-image: *//')"
|
||||
if starts KinesisAnalyticsFlinkRestartNightlyIntegrationTest; then
|
||||
[ -n "$FLINK_IMAGE" ] && pull "$FLINK_IMAGE"
|
||||
[ -n "$EFS_INIT_IMAGE" ] && pull "$EFS_INIT_IMAGE"
|
||||
fi
|
||||
if [ -n "$ECR_PUBLIC_IMAGES" ]; then
|
||||
{ for image in $ECR_PUBLIC_IMAGES; do pull_and_log "$image"; sleep 1; done; } &
|
||||
fi
|
||||
|
||||
Reference in new issue
Block a user