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 0353205751 Fix misleading success log when schema drop returns false 
(#10722)
0353205751 is described below

commit 035320575161124ecfc3f80be38744c70aac79fe
Author: Lukas Simek <[email protected]>
AuthorDate: Fri Apr 10 05:04:14 2026 +0200

    Fix misleading success log when schema drop returns false (#10722)
    
    What changes were proposed in this pull request?
    This PR fixes an issue where SchemaOperations.dropSchema logged "Schema
    dropped" even when the drop operation returned false. Logging is now
    conditional on the actual result.
    
    Why are the changes needed?
    The previous behavior produced misleading success logs. This fix ensures
    that logs accurately reflect the real outcome of the drop operation.
    
    Fix: #10219
    
    Does this PR introduce any user-facing change?
    No. Only the logging behavior is corrected; no API or functional
    behavior is changed.
    
    How was this patch tested?
    The change was tested manually:
    
    When dispatcher.dropSchema(...) returns true -> an INFO log "Schema
    dropped" is emitted.
    
    When it returns false -> a WARN log "Fail to drop schema ..." is
    emitted.
---
 .../org/apache/gravitino/server/web/rest/SchemaOperations.java     | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git 
a/server/src/main/java/org/apache/gravitino/server/web/rest/SchemaOperations.java
 
b/server/src/main/java/org/apache/gravitino/server/web/rest/SchemaOperations.java
index 4eede74191..bbacfdf9f5 100644
--- 
a/server/src/main/java/org/apache/gravitino/server/web/rest/SchemaOperations.java
+++ 
b/server/src/main/java/org/apache/gravitino/server/web/rest/SchemaOperations.java
@@ -230,11 +230,14 @@ public class SchemaOperations {
           () -> {
             NameIdentifier ident = NameIdentifierUtil.ofSchema(metalake, 
catalog, schema);
             boolean dropped = dispatcher.dropSchema(ident, cascade);
-            if (!dropped) {
+
+            if (dropped) {
+              LOG.info("Schema dropped: {}.{}.{}", metalake, catalog, schema);
+            } else {
               LOG.warn("Fail to drop schema {} under namespace {}", schema, 
ident.namespace());
             }
+
             Response response = Utils.ok(new DropResponse(dropped));
-            LOG.info("Schema dropped: {}.{}.{}", metalake, catalog, schema);
             return response;
           });
     } catch (Exception e) {

Reply via email to