xiangfu0 commented on code in PR #19916:
URL: https://github.com/apache/pinot/pull/19916#discussion_r4332393306


##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/core/assignment/segment/RealtimeSegmentAssignment.java:
##########
@@ -158,8 +178,100 @@ protected List<String> assignConsumingSegment(int 
segmentPartitionId, InstancePa
     }
   }
 
+  /// Assigns a CONSUMING segment of a partition-pinned table to the instances 
of its partition, see
+  /// [BaseSegmentAssignment#getOrCreatePartitionInstances].
+  private List<String> assignPinnedConsumingSegment(String segmentName, 
IdealState idealState,
+      InstancePartitions instancePartitions) {
+    Integer partitionId =
+        SegmentUtils.getSegmentPartitionId(segmentName, _tableNameWithType, 
_helixManager, _partitionColumn);
+    Preconditions.checkState(partitionId != null, "Failed to find partition id 
for segment: %s of table: %s",

Review Comment:
   **Realtime strictReplicaGroup tables that are not upsert/dedup now hard-fail 
on segments without a derivable partition id.** They are partition-pinned by 
this PR, and both `assignPinnedConsumingSegment` (here) and 
`getTargetInstances` (line 407) throw `Failed to find partition id`, where the 
base fell back to `getSegmentPartitionIdOrDefault` (hash). Example: uploading a 
custom-named segment or a MergeRollupTask `merged_...` output (supported for 
non-upsert realtime tables) to such a table without segmentPartitionConfig 
fails inside the IdealState updater and its ZK metadata is deleted; if such a 
segment already exists, every rebalance (REST, tenant, SegmentRelocator) 
returns FAILED. `OfflineSegmentAssignment` falls back to the strategy in the 
same case.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to