This is an automated email from the ASF dual-hosted git repository.
jmclean pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/gravitino.git
The following commit(s) were added to refs/heads/main by this push:
new 7b4cf0eae6 [#10628] fix(server): Only log success message when
dropFunction actually drops (#10632)
7b4cf0eae6 is described below
commit 7b4cf0eae6d185243edbee9bbd7fe1cf08b4db1a
Author: Sachin Ranjalkar <[email protected]>
AuthorDate: Thu Apr 2 06:31:02 2026 +0530
[#10628] fix(server): Only log success message when dropFunction actually
drops (#10632)
### What changes were proposed in this pull request?
Moved the success `LOG.info("Function dropped: ...")` inside the `else`
branch of the `dropped` check, so it only fires when the function was
actually dropped.
### Why are the changes needed?
`FunctionOperations.dropFunction()` unconditionally logs "Function
dropped" even when `dispatcher.dropFunction()` returns false. This
produces misleading log output.
Fix: #10628
### Does this PR introduce _any_ user-facing change?
No.
### How was this patch tested?
Existing `TestFunctionOperations.testDropFunction()` covers both
`dropped=true` and `dropped=false` paths. The fix follows the same
pattern applied to `CatalogOperations` in PR #8351.
Co-authored-by: Bharath Krishna <[email protected]>
---
.../java/org/apache/gravitino/server/web/rest/FunctionOperations.java | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git
a/server/src/main/java/org/apache/gravitino/server/web/rest/FunctionOperations.java
b/server/src/main/java/org/apache/gravitino/server/web/rest/FunctionOperations.java
index da59cc238c..b4b6c4c7a8 100644
---
a/server/src/main/java/org/apache/gravitino/server/web/rest/FunctionOperations.java
+++
b/server/src/main/java/org/apache/gravitino/server/web/rest/FunctionOperations.java
@@ -245,9 +245,10 @@ public class FunctionOperations {
boolean dropped = dispatcher.dropFunction(ident);
if (!dropped) {
LOG.warn("Cannot find to be dropped function {} under schema
{}", function, schema);
+ } else {
+ LOG.info("Function dropped: {}.{}.{}.{}", metalake, catalog,
schema, function);
}
Response response = Utils.ok(new DropResponse(dropped));
- LOG.info("Function dropped: {}.{}.{}.{}", metalake, catalog,
schema, function);
return response;
});
} catch (Exception e) {