jihoonson commented on a change in pull request #7246: Fix record validation in 
SeekableStreamIndexTaskRunner
URL: https://github.com/apache/incubator-druid/pull/7246#discussion_r264981329
 
 

 ##########
 File path: 
indexing-service/src/main/java/org/apache/druid/indexing/seekablestream/SeekableStreamIndexTaskRunner.java
 ##########
 @@ -1882,33 +1882,35 @@ TransactionalSegmentPublisher 
createPublisher(TaskToolbox toolbox, boolean useTr
   }
 
   private boolean verifyInitialRecordAndSkipExclusivePartition(
-      final OrderedPartitionableRecord<PartitionIdType, SequenceOffsetType> 
record,
-      final Map<PartitionIdType, SequenceOffsetType> intialSequenceSnapshot
+      final OrderedPartitionableRecord<PartitionIdType, SequenceOffsetType> 
record
   )
   {
-    if (intialSequenceSnapshot.containsKey(record.getPartitionId())) {
-      if 
(record.getSequenceNumber().compareTo(intialSequenceSnapshot.get(record.getPartitionId()))
 < 0) {
-        throw new ISE(
-            "Starting sequenceNumber [%s] does not match expected [%s] for 
partition [%s]",
-            record.getSequenceNumber(),
-            intialSequenceSnapshot.get(record.getPartitionId()),
-            record.getPartitionId()
+    // Check only for the first record among the record batch.
+    if (initialOffsetsSnapshot.contains(record.getPartitionId())) {
+      final SequenceOffsetType currOffset = 
currOffsets.get(record.getPartitionId());
+      if (currOffset != null) {
 
 Review comment:
   Hmm, maybe it's better to throw an error if it's null. Will raise a PR.

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


With regards,
Apache Git Services

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

Reply via email to