This is an automated email from the ASF dual-hosted git repository.

gortiz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/pinot.git


The following commit(s) were added to refs/heads/master by this push:
     new 35f80826ca Log table config and schema updates (#13867)
35f80826ca is described below

commit 35f80826ca2dd67642cfd73698312b7be64f8593
Author: Yash Mayya <yash.ma...@gmail.com>
AuthorDate: Wed Aug 21 20:48:12 2024 +0530

    Log table config and schema updates (#13867)
    
    Adds logs whenever we create, update or delete table configs and schemas. 
Logs that create and update schema/tableConfig include the new value in the log.
    
    This can be used to track changes in these important configurations
---
 .../pinot/controller/api/resources/PinotSchemaRestletResource.java   | 5 +++--
 .../pinot/controller/api/resources/PinotTableRestletResource.java    | 3 +++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSchemaRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSchemaRestletResource.java
index 876dd04be9..4b2c1e33c9 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSchemaRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotSchemaRestletResource.java
@@ -388,7 +388,7 @@ public class PinotSchemaRestletResource {
       // Best effort notification. If controller fails at this point, no 
notification is given.
       LOGGER.info("Notifying metadata event for adding new schema {}", 
schemaName);
       _metadataEventNotifierFactory.create().notifyOnSchemaEvents(schema, 
SchemaEventType.CREATE);
-
+      LOGGER.info("Successfully added schema: {} with value: {}", schemaName, 
schema);
       return new SuccessResponse(schemaName + " successfully added");
     } catch (SchemaAlreadyExistsException e) {
       
_controllerMetrics.addMeteredGlobalValue(ControllerMeter.CONTROLLER_SCHEMA_UPLOAD_ERROR,
 1L);
@@ -425,6 +425,7 @@ public class PinotSchemaRestletResource {
       // Best effort notification. If controller fails at this point, no 
notification is given.
       LOGGER.info("Notifying metadata event for updating schema: {}", 
schemaName);
       _metadataEventNotifierFactory.create().notifyOnSchemaEvents(schema, 
SchemaEventType.UPDATE);
+      LOGGER.info("Successfully updated schema: {} with new value: {}", 
schemaName, schema);
       return new SuccessResponse(schema.getSchemaName() + " successfully 
added");
     } catch (SchemaNotFoundException e) {
       
_controllerMetrics.addMeteredGlobalValue(ControllerMeter.CONTROLLER_SCHEMA_UPLOAD_ERROR,
 1L);
@@ -524,7 +525,7 @@ public class PinotSchemaRestletResource {
     if (_pinotHelixResourceManager.deleteSchema(schemaName)) {
       LOGGER.info("Notifying metadata event for deleting schema: {}", 
schemaName);
       _metadataEventNotifierFactory.create().notifyOnSchemaEvents(schema, 
SchemaEventType.DELETE);
-      LOGGER.info("Success: Deleted schema {}", schemaName);
+      LOGGER.info("Successfully deleted schema: {}", schemaName);
     } else {
       throw new ControllerApplicationException(LOGGER, String.format("Failed 
to delete schema %s", schemaName),
           Response.Status.INTERNAL_SERVER_ERROR);
diff --git 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
index 7a5fb1936b..bc7d16bde6 100644
--- 
a/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
+++ 
b/pinot-controller/src/main/java/org/apache/pinot/controller/api/resources/PinotTableRestletResource.java
@@ -238,6 +238,7 @@ public class PinotTableRestletResource {
       // TODO: validate that table was created successfully
       // (in realtime case, metadata might not have been created but would be 
created successfully in the next run of
       // the validation manager)
+      LOGGER.info("Successfully added table: {} with config: {}", 
tableNameWithType, tableConfig);
       return new ConfigSuccessResponse("Table " + tableNameWithType + " 
successfully added",
           tableConfigAndUnrecognizedProperties.getRight());
     } catch (Exception e) {
@@ -432,6 +433,7 @@ public class PinotTableRestletResource {
         }
       }
       if (!tablesDeleted.isEmpty()) {
+        tablesDeleted.forEach(deletedTableName -> LOGGER.info("Successfully 
deleted table: {}", deletedTableName));
         return new SuccessResponse("Tables: " + tablesDeleted + " deleted");
       }
     } catch (Exception e) {
@@ -515,6 +517,7 @@ public class PinotTableRestletResource {
       
_controllerMetrics.addMeteredGlobalValue(ControllerMeter.CONTROLLER_TABLE_UPDATE_ERROR,
 1L);
       throw e;
     }
+    LOGGER.info("Successfully updated table: {} with new config: {}", 
tableNameWithType, tableConfig);
     return new ConfigSuccessResponse("Table config updated for " + tableName,
         tableConfigAndUnrecognizedProperties.getRight());
   }


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to