sajjad-moradi commented on code in PR #12188:
URL: https://github.com/apache/pinot/pull/12188#discussion_r1434369527


##########
pinot-controller/src/test/java/org/apache/pinot/controller/helix/core/realtime/segment/SegmentFlushThresholdComputerTest.java:
##########
@@ -105,6 +106,28 @@ public void 
testUseLastSegmentsThresholdIfSegmentSizeMissing() {
     assertEquals(threshold, segmentSizeThreshold);
   }
 
+  @Test
+  public void 
testUseLastSegmentsThresholdIfSegmentIsCommittingDueToForceCommit() {
+    long committingSegmentSizeBytes = 500_000L;
+    int committingSegmentSizeThreshold = 25_000;
+    SegmentFlushThresholdComputer computer = new 
SegmentFlushThresholdComputer();
+
+    CommittingSegmentDescriptor committingSegmentDescriptor = 
mock(CommittingSegmentDescriptor.class);
+    
when(committingSegmentDescriptor.getSegmentSizeBytes()).thenReturn(committingSegmentSizeBytes);
+    
when(committingSegmentDescriptor.getStopReason()).thenReturn(REASON_FORCE_COMMIT_MESSAGE_RECEIVED);

Review Comment:
   I have actually considered the upgrade scenario, and I believe a unit test 
is unnecessary in this case. This is because the behavior during the upgrade 
will be managed in the same way as it was before the upgrade, with the 
threshold being calculated using much lower values. To put it differently, the 
miscalculation bug is present both before and during the upgrade. However, 
after the upgrade, the bug is resolved.



-- 
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-unsubscr...@pinot.apache.org

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


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

Reply via email to