You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@druid.apache.org by "github-advanced-security[bot] (via GitHub)" <gi...@apache.org> on 2024/03/15 17:47:23 UTC

Re: [PR] Fix Cannot mark an unqueryable datasource's segments used / unused (druid)

github-advanced-security[bot] commented on code in PR #16127:
URL: https://github.com/apache/druid/pull/16127#discussion_r1526634863


##########
server/src/main/java/org/apache/druid/server/http/DataSourcesResource.java:
##########
@@ -209,31 +209,41 @@
       MarkDataSourceSegmentsPayload payload
   )
   {
-    SegmentUpdateOperation operation = () -> {
-      final Interval interval = payload.getInterval();
-      if (interval != null) {
-        return segmentsMetadataManager.markAsUsedNonOvershadowedSegmentsInInterval(dataSourceName, interval);
-      } else {
-        final Set<String> segmentIds = payload.getSegmentIds();
-        if (segmentIds == null || segmentIds.isEmpty()) {
-          return 0;
-        }
+    if (payload == null || !payload.isValid()) {
+      log.warn("Invalid request payload: [%s]", payload);

Review Comment:
   ## Use of default toString()
   
   Default toString(): MarkDataSourceSegmentsPayload inherits toString() from Object, and so is not suitable for printing.
   
   [Show more details](https://github.com/apache/druid/security/code-scanning/2837)



-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@druid.apache.org

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