Vamsi-klu commented on code in PR #19088:
URL: https://github.com/apache/pinot/pull/19088#discussion_r4647654431


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -735,12 +736,28 @@ private boolean processStreamEvents(MessageBatch 
messageBatch, long idlePipeSlee
                 
_serverMetrics.addMeteredGlobalValue(ServerMeter.REALTIME_BYTES_CONSUMED, 
recordSerializedValueLength);
               }
             } catch (Exception e) {
-              _numRowsErrored++;
-              _numBytesDropped += rowSizeInBytes;
               String errorMessage =
                   "Caught exception while indexing the record at offset: " + 
offset + " , row: " + transformedRow;
               _segmentLogger.error(errorMessage, e);
               _realtimeTableDataManager.addSegmentError(_segmentNameStr, new 
SegmentErrorInfo(now(), errorMessage, e));
+              // continueOnError=false finishes a started row, then rethrows. 
A published repair is consumed;
+              // only an unpublished failure is a drop. An unrecoverable 
repair is terminal.
+              if (_realtimeSegment.getNumDocsIndexed() > docsBeforeIndex) {
+                indexedMessageCount++;
+                _lastRowMetadata = metadata;
+                _lastConsumedTimestampMs = System.currentTimeMillis();
+                realtimeRowsConsumedMeter =
+                    _serverMetrics.addMeteredTableValue(_clientId, 
ServerMeter.REALTIME_ROWS_CONSUMED, 1,
+                        realtimeRowsConsumedMeter);
+                
_serverMetrics.addMeteredGlobalValue(ServerMeter.REALTIME_ROWS_CONSUMED, 1L);
+              } else {
+                _numRowsErrored++;
+                _numBytesDropped += rowSizeInBytes;
+              }
+              canTakeMore = _realtimeSegment.canTakeMoreRows();
+              if (!canTakeMore) {
+                throw new RuntimeException(errorMessage, e);

Review Comment:
   **Local validation update.** The repair and tests described below are staged 
locally. The published PR head is `c4893335b8`.
   
   I separated completed row publication from terminal failure in both callers. 
A repaired capacity-filling row advances the stream offset and completes. A 
failed write that would leave an unreadable row stops the segment at that 
offset. The real-segment regression uses capacity one and invalid JSON. I also 
covered publication into an existing aggregate, where the doc count stays the 
same.
   
   Drafted-by: OpenAI Codex (GPT-6); reviewed by @Vamsi-klu before posting



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