You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by GitBox <gi...@apache.org> on 2021/03/11 05:57:53 UTC

[GitHub] [druid] clintropolis commented on a change in pull request #10956: [Minor]Add metadata-related logs and missing UT for kill tasks.

clintropolis commented on a change in pull request #10956:
URL: https://github.com/apache/druid/pull/10956#discussion_r592084345



##########
File path: server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
##########
@@ -1290,9 +1294,12 @@ public Void inTransaction(Handle handle, TransactionStatus transactionStatus)
 
   private void deleteSegment(final Handle handle, final DataSegment segment)
   {
-    handle.createStatement(StringUtils.format("DELETE from %s WHERE id = :id", dbTables.getSegmentsTable()))
-          .bind("id", segment.getId().toString())
-          .execute();
+    String segmentsTable = dbTables.getSegmentsTable();
+    String segmentId = segment.getId().toString();
+    log.debug("Removing segment [%s] [%s] from Metadata Storage [%s]!", segmentId, segment.getDataSource(), segmentsTable);

Review comment:
       nit: I guess this could be a lot of segments, it might be nicer to pull this outside of the loop and use `log.debugSegments`

##########
File path: server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java
##########
@@ -1278,9 +1278,13 @@ public void deleteSegments(final Set<DataSegment> segments)
           @Override
           public Void inTransaction(Handle handle, TransactionStatus transactionStatus)
           {
+            int segmentSize = segments.size();
+            String dataSource = "";
             for (final DataSegment segment : segments) {
+              dataSource = segment.getDataSource();
               deleteSegment(handle, segment);
             }
+            log.info("Removed [%d] segments'metadata for dataSource [%s]!", segmentSize, dataSource);

Review comment:
       ```suggestion
               log.info("Removed [%d] segments from metadata for dataSource [%s]!", segmentSize, dataSource);
   ```




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org
For additional commands, e-mail: commits-help@druid.apache.org