Skip to content

Commit 954893b

Browse files
committed
operator debug logs
1 parent 059dc21 commit 954893b

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

flink-kubernetes-operator/src/main/java/org/apache/flink/kubernetes/operator/reconciler/deployment/AbstractJobReconciler.java

+9-4
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,13 @@ protected JobUpgrade getJobUpgrade(FlinkResourceContext<CR> ctx, Configuration d
285285

286286
boolean cancellable = allowLastStateCancel(ctx);
287287
if (running) {
288-
return getUpgradeModeBasedOnStateAge(ctx, deployConfig, cancellable);
288+
var mode = getUpgradeModeBasedOnStateAge(ctx, deployConfig, cancellable);
289+
LOG.info("Job is running, using {} for last-state upgrade", mode);
290+
return mode;
289291
}
290292

291293
if (cancellable) {
292-
LOG.info("Using cancel to perform last-state upgrade");
294+
LOG.info("Job is not running, using cancel to perform last-state upgrade");
293295
return JobUpgrade.lastStateUsingCancel();
294296
}
295297
}
@@ -356,8 +358,11 @@ private boolean allowLastStateCancel(FlinkResourceContext<CR> ctx) {
356358
}
357359

358360
var conf = ctx.getObserveConfig();
359-
return conf.get(KubernetesOperatorConfigOptions.OPERATOR_JOB_UPGRADE_LAST_STATE_CANCEL_JOB)
360-
|| !ctx.getFlinkService().isHaMetadataAvailable(conf);
361+
if (!ctx.getFlinkService().isHaMetadataAvailable(conf)) {
362+
LOG.info("HA metadata not available, cancel will be used instead of last-state");
363+
return true;
364+
}
365+
return conf.get(KubernetesOperatorConfigOptions.OPERATOR_JOB_UPGRADE_LAST_STATE_CANCEL_JOB);
361366
}
362367

363368
protected void restoreJob(

helm/flink-kubernetes-operator/conf/log4j-operator.properties

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
# limitations under the License.
1717
################################################################################
1818

19-
rootLogger.level = DEBUG
19+
rootLogger.level = INFO
2020
rootLogger.appenderRef.console.ref = ConsoleAppender
2121

2222
# Log all infos to the console

0 commit comments

Comments
 (0)