From 2876fc31f0c43da2b543a27049f36ec42283518c Mon Sep 17 00:00:00 2001 From: Kishore Date: Thu, 23 Jun 2022 00:25:18 +0530 Subject: [PATCH] Fixed 0 row count issue after recovering --- .../io/prestosql/execution/scheduler/SqlQueryScheduler.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/presto-main/src/main/java/io/prestosql/execution/scheduler/SqlQueryScheduler.java b/presto-main/src/main/java/io/prestosql/execution/scheduler/SqlQueryScheduler.java index 8c6afaa15..d18b88c04 100644 --- a/presto-main/src/main/java/io/prestosql/execution/scheduler/SqlQueryScheduler.java +++ b/presto-main/src/main/java/io/prestosql/execution/scheduler/SqlQueryScheduler.java @@ -97,6 +97,7 @@ import static io.prestosql.SystemSessionProperties.getConcurrentLifespansPerNode import static io.prestosql.SystemSessionProperties.getWriterMinSize; import static io.prestosql.SystemSessionProperties.isReuseTableScanEnabled; import static io.prestosql.execution.BasicStageStats.aggregateBasicStageStats; +import static io.prestosql.execution.QueryState.RECOVERING; import static io.prestosql.execution.SqlStageExecution.createSqlStageExecution; import static io.prestosql.execution.StageState.ABORTED; import static io.prestosql.execution.StageState.CANCELED; @@ -106,7 +107,6 @@ import static io.prestosql.execution.StageState.RUNNING; import static io.prestosql.execution.StageState.SCHEDULED; import static io.prestosql.execution.scheduler.SourcePartitionedScheduler.newSourcePartitionedSchedulerAsStageScheduler; import static io.prestosql.snapshot.RecoveryConfig.calculateTaskCount; -import static io.prestosql.snapshot.RecoveryState.STOPPING_FOR_RESCHEDULE; import static io.prestosql.spi.StandardErrorCode.GENERIC_INTERNAL_ERROR; import static io.prestosql.spi.StandardErrorCode.NO_NODES_AVAILABLE; import static io.prestosql.spi.connector.CatalogName.isInternalSystemConnector; @@ -859,7 +859,7 @@ public class SqlQueryScheduler RuntimeException closeError = new RuntimeException(); for (StageScheduler scheduler : stageSchedulers.values()) { try { - if (queryRecoveryManager.getState() != STOPPING_FOR_RESCHEDULE) { + if (queryStateMachine.getQueryState() != RECOVERING && !queryRecoveryManager.isRecovering()) { scheduler.close(); } }