suvodeep-pyne commented on code in PR #20076:
URL: https://github.com/apache/pinot/pull/20076#discussion_r4416959014


##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/RealtimeSegmentDataManager.java:
##########
@@ -664,6 +674,8 @@ private boolean processStreamEvents(MessageBatch 
messageBatch, long idlePipeSlee
       StreamPartitionMsgOffset nextOffset = metadata.getNextOffset();
       int rowSizeInBytes = metadata.getRecordSerializedSize();
       if (decodedRow.getException() != null) {
+        // A failed schema-registry lookup drops the row, so every failed row 
is classified and written at once.
+        recordSourceError("decode", decodedRow.getException(), true);

Review Comment:
   Owner decision: keep per-row recording as it is. A time window that skips 
classification can miss or delay a refusal, and the cost falls only on rows 
that Pinot drops, on a path that is already faster than the per-row ERROR log 
on master. Resolving; please reopen if you disagree.



##########
pinot-core/src/main/java/org/apache/pinot/core/data/manager/realtime/IngestionSourceErrorRecorder.java:
##########
@@ -0,0 +1,126 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.pinot.core.data.manager.realtime;
+
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.TimeUnit;
+import org.apache.pinot.common.metrics.ServerGauge;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.apache.pinot.spi.ingestion.error.IngestionSourceErrorCategory;
+import org.apache.pinot.spi.ingestion.error.IngestionSourceErrorClassification;
+import org.apache.pinot.spi.ingestion.error.IngestionSourceErrorClassifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+
+/// Records the stream source failures a realtime table's consumers and its 
ingestion delay tracker see: a timestamp
+/// gauge per partition and category, and a WARN line per write, rate-limited 
per category.
+///
+/// [IngestionSourceErrorCategory#AUTH] is written at every refusal, whether 
or not Pinot retries.
+/// [IngestionSourceErrorCategory#SOURCE_READ] is written only once Pinot 
gives up on the source, so a transient
+/// failure it recovers from writes nothing. The gauges record when a failure 
last happened: they are never cleared on
+/// success or when a partition stops consuming, only when the table data 
manager shuts down ([#close]).

Review Comment:
   Owner decision: keep this behaviour in this PR. We would rather handle 
metric cleanup when a partition leaves a server as its own change than grow 
this PR. Until then the values stay true (the last failure this server saw), so 
freshness alerts still read correctly, and the extra series are at most two per 
partition that had a failure here. Resolving; please reopen if you disagree.



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