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 2022/09/15 04:39:56 UTC

[GitHub] [druid] AmatyaAvadhanula commented on a diff in pull request #13070: Allocate numCorePartitions using only used segments

AmatyaAvadhanula commented on code in PR #13070:
URL: https://github.com/apache/druid/pull/13070#discussion_r971516930


##########
server/src/main/java/org/apache/druid/metadata/IndexerSQLMetadataStorageCoordinator.java:
##########
@@ -848,6 +848,11 @@ private SegmentIdWithShardSpec createNewSegment(
         versionOfExistingChunk = null;
       }
 
+      // The number of core partitions must always be chosen from the set of used segments in the VersionedIntervalTimeline.
+      // When the core partitions have been dropped, using pending segments may lead to an incorrect state
+      // where the chunk is believed to have core partitions and queries results are incorrect.
+      int numCorePartitions = maxId == null ? 0 : maxId.getShardSpec().getNumCorePartitions();

Review Comment:
   @imply-cheddar , thank you for the review. I've made the changes that you suggested



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