9aman commented on code in PR #14798:
URL: https://github.com/apache/pinot/pull/14798#discussion_r1917770366
##########
pinot-controller/src/main/java/org/apache/pinot/controller/validation/RealtimeSegmentValidationManager.java:
##########
@@ -171,6 +172,9 @@ private void runSegmentLevelValidation(TableConfig
tableConfig) {
// Update the total document count gauge
_validationMetrics.updateTotalDocumentCountGauge(realtimeTableName,
computeTotalDocumentCount(segmentsZKMetadata));
+
_llcRealtimeSegmentManager.reIngestSegmentsWithErrorState(tableConfig.getTableName());
+//
_llcRealtimeSegmentManager.resetUploadedSegmentsInErrorState(tableConfig.getTableName());
Review Comment:
Removed
##########
pinot-integration-tests/src/test/java/org/apache/pinot/integration/tests/realtime/FailureInjectingRealtimeSegmentDataManager.java:
##########
@@ -0,0 +1,67 @@
+/**
+ * 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.integration.tests.realtime;
+
+import java.util.concurrent.Semaphore;
+import org.apache.pinot.common.metadata.segment.SegmentZKMetadata;
+import org.apache.pinot.common.metrics.ServerMetrics;
+import org.apache.pinot.common.utils.LLCSegmentName;
+import org.apache.pinot.core.data.manager.realtime.RealtimeSegmentDataManager;
+import org.apache.pinot.core.data.manager.realtime.RealtimeTableDataManager;
+import org.apache.pinot.segment.local.segment.index.loader.IndexLoadingConfig;
+import org.apache.pinot.spi.config.table.TableConfig;
+import org.apache.pinot.spi.data.Schema;
+import org.apache.pinot.spi.utils.retry.AttemptsExceededException;
+import org.apache.pinot.spi.utils.retry.RetriableOperationException;
+
+
+/**
+ * A specialized RealtimeSegmentDataManager that lets us inject a forced
failure
+ * in the commit step, which occurs strictly after the segmentConsumed message.
+ */
+public class FailureInjectingRealtimeSegmentDataManager extends
RealtimeSegmentDataManager {
+
+ // This flag controls whether commit should forcibly fail.
+ private final boolean _failCommit;
+
+ /**
+ * Creates a manager that will forcibly fail the commit segment step.
+ */
+ public FailureInjectingRealtimeSegmentDataManager(SegmentZKMetadata
segmentZKMetadata,
+ TableConfig tableConfig, RealtimeTableDataManager
realtimeTableDataManager, String resourceDataDir,
+ IndexLoadingConfig indexLoadingConfig, Schema schema, LLCSegmentName
llcSegmentName,
+ Semaphore partitionGroupConsumerSemaphore, ServerMetrics serverMetrics,
+ boolean failCommit) throws AttemptsExceededException,
RetriableOperationException {
+ // Pass through to the real parent constructor
+ super(segmentZKMetadata, tableConfig, realtimeTableDataManager,
resourceDataDir,
+ indexLoadingConfig, schema, llcSegmentName,
partitionGroupConsumerSemaphore, serverMetrics,
+ null /* no PartitionUpsertMetadataManager */, null /* no
PartitionDedupMetadataManager */,
+ () -> true /* isReadyToConsumeData always true for tests */);
+
+ _failCommit = failCommit;
+ }
+
+ protected SegmentBuildDescriptor buildSegmentInternal(boolean forCommit) {
+ if (_failCommit) {
+ System.out.println("Forcing failure in buildSegmentInternal");
Review Comment:
Removed
--
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]