Skip to content

Commit df66432

Browse files
committed
operator debug logs
1 parent 059dc21 commit df66432

File tree

2 files changed

+9
-5
lines changed

2 files changed

+9
-5
lines changed

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

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -285,11 +285,12 @@ 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);
289290
}
290291

291292
if (cancellable) {
292-
LOG.info("Using cancel to perform last-state upgrade");
293+
LOG.info("Job is not running, using cancel to perform last-state upgrade");
293294
return JobUpgrade.lastStateUsingCancel();
294295
}
295296
}
@@ -356,8 +357,11 @@ private boolean allowLastStateCancel(FlinkResourceContext<CR> ctx) {
356357
}
357358

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

363367
protected void restoreJob(

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

Lines changed: 1 addition & 1 deletion
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)