Skip to content

Commit 04ed019

Browse files
dantengskyBohuTANG
andcommitted
chore: improve license validation log message (#17967)
* chore: improve license validation log message Change license validation error log to ERROR level. Several enterprise features don't affect functional correctness but impact performance significantly. Users have experienced unexplained performance degradation due to expired licenses. This change helps users identify such issues faster. * improve the license error message * tweak log msg --------- Co-authored-by: BohuTANG <[email protected]>
1 parent d785def commit 04ed019

File tree

1 file changed

+16
-2
lines changed

1 file changed

+16
-2
lines changed

src/query/service/src/interpreters/interpreter.rs

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,20 @@ pub trait Interpreter: Sync + Send {
9191

9292
ctx.set_status_info("building pipeline");
9393
ctx.check_aborting().with_context(make_error)?;
94+
95+
let enable_disk_cache = match LicenseManagerSwitch::instance()
96+
.check_license(ctx.get_license_key())
97+
{
98+
Ok(_) => true,
99+
Err(e) => {
100+
log::error!(
101+
"[Interpreter] CRITICAL ALERT: License validation FAILED - enterprise features DISABLED, System may operate in DEGRADED MODE with LIMITED CAPABILITIES and REDUCED PERFORMANCE. Please contact us at https://www.databend.com/contact-us/ or email [email protected] to restore full functionality: {}",
102+
e
103+
);
104+
false
105+
}
106+
};
107+
94108
if self.is_ddl() {
95109
CommitInterpreter::try_create(ctx.clone())?
96110
.execute2()
@@ -175,7 +189,7 @@ fn log_query_start(ctx: &QueryContext) {
175189
}
176190

177191
if let Err(error) = InterpreterQueryLog::log_start(ctx, now, None) {
178-
error!("interpreter.start.error: {:?}", error)
192+
error!("[Interpreter] Query start logging failed: {:?}", error)
179193
}
180194
}
181195

@@ -192,7 +206,7 @@ fn log_query_finished(ctx: &QueryContext, error: Option<ErrorCode>, has_profiles
192206
}
193207

194208
if let Err(error) = InterpreterQueryLog::log_finish(ctx, now, error, has_profiles) {
195-
error!("interpreter.finish.error: {:?}", error)
209+
error!("[Interpreter] Query finish logging failed: {:?}", error)
196210
}
197211
}
198212

0 commit comments

Comments
 (0)