Skip to content

Commit

Permalink
Fixed static analysis
Browse files Browse the repository at this point in the history
  • Loading branch information
gaojieliu committed Feb 2, 2024
1 parent db27699 commit 0085e0e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -809,11 +809,8 @@ protected boolean isReadyToServe(PartitionConsumptionState partitionConsumptionS

try {
// Looks like none of the short-circuitry fired, so we need to measure lag!
long offsetThreshold = getOffsetToOnlineLagThresholdPerPartition(
hybridStoreConfig,
storeRepository,
storeName,
subPartitionCount);
long offsetThreshold =
getOffsetToOnlineLagThresholdPerPartition(hybridStoreConfig, storeRepository, storeName, subPartitionCount);
long producerTimeLagThresholdInSeconds =
hybridStoreConfig.get().getProducerTimestampLagThresholdToGoOnlineInSeconds();
String msg = msgForLagMeasurement[partitionId];
Expand Down Expand Up @@ -1160,7 +1157,7 @@ private void processIngestionException() {
*/
if (partitionException instanceof MemoryLimitExhaustedException
|| partitionException.getCause() instanceof MemoryLimitExhaustedException
&& isCurrentVersion.getAsBoolean()) {
&& isCurrentVersion.getAsBoolean()) {
LOGGER.warn(
"Encountered MemoryLimitExhaustedException, and ingestion task will try to reopen the database and"
+ " resume the consumption after killing ingestion tasks for non current versions");
Expand Down Expand Up @@ -1708,11 +1705,8 @@ private void checkConsumptionStateWhenStart(
long offsetLagDeltaRelaxFactor = serverConfig.getOffsetLagDeltaRelaxFactorForFastOnlineTransitionInRestart();
long previousOffsetLag = newPartitionConsumptionState.getOffsetRecord().getOffsetLag();
if (hybridStoreConfig.isPresent() && newPartitionConsumptionState.isEndOfPushReceived()) {
long offsetLagThreshold = getOffsetToOnlineLagThresholdPerPartition(
hybridStoreConfig,
storeRepository,
storeName,
subPartitionCount);
long offsetLagThreshold =
getOffsetToOnlineLagThresholdPerPartition(hybridStoreConfig, storeRepository, storeName, subPartitionCount);
// Only enable this feature with positive offset lag delta relax factor and offset lag threshold.
if (offsetLagDeltaRelaxEnabled && offsetLagThreshold > 0) {
long offsetLag = measureHybridOffsetLag(newPartitionConsumptionState, true);
Expand Down Expand Up @@ -2880,8 +2874,8 @@ protected void validateMessage(

return (isDataRecovery && isHybridMode() && partitionConsumptionState.getTopicSwitch() == null)
|| (topicManager.isTopicCompactionEnabled(pubSubTopic)
&& LatencyUtils.getElapsedTimeInMs(consumerRecord.getPubSubMessageTime()) >= topicManager
.getTopicMinLogCompactionLagMs(pubSubTopic));
&& LatencyUtils.getElapsedTimeInMs(consumerRecord.getPubSubMessageTime()) >= topicManager
.getTopicMinLogCompactionLagMs(pubSubTopic));
});

try {
Expand Down Expand Up @@ -3863,4 +3857,4 @@ public boolean isProducingVersionTopicHealthy() {
}
return true;
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2550,9 +2550,12 @@ public void testPartitionExceptionIsolation(AAConfig aaConfig) throws Exception
assertNull(
storeIngestionTaskUnderTest.getPartitionIngestionExceptionList().get(PARTITION_FOO),
"Exception for the errored partition should be cleared after unsubscription");
assertEquals(storeIngestionTaskUnderTest.getFailedPartitions().size(), 1, "Only one partition should be failed");
assertEquals(
storeIngestionTaskUnderTest.getFailedPartitions().size(),
1,
"Only one partition should be failed");
});
}, aaConfig);
}, aaConfig);
for (int i = 0; i < 10000; ++i) {
storeIngestionTaskUnderTest
.setIngestionException(0, new VeniceException("new fake looooooooooooooooong exception"));
Expand Down

0 comments on commit 0085e0e

Please sign in to comment.