Skip to content

Commit b7e95cb

Browse files
authored
[stable-25-3-1]: SQS: don't reload infly on successful read (#28065)
LOGBROKER-10046
2 parents f191f9e + b3d3feb commit b7e95cb

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

ydb/core/ymq/actor/queue_leader.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -963,8 +963,8 @@ void TQueueLeader::OnLoadStdMessageResult(const TString& requestId, const ui64 o
963963

964964
--reqInfo.LoadAnswersLeft;
965965
if (success) {
966-
bool deleted = true;
967-
bool deadlineChanged = true;
966+
bool deleted = false;
967+
bool deadlineChanged = false;
968968
const bool exists = (*messageRecord)["Exists"];
969969
const auto wasDeadLetterValue = (*messageRecord)["IsDeadLetter"];
970970
const bool wasDeadLetter = wasDeadLetterValue.HaveValue() ? bool(wasDeadLetterValue) : false;
@@ -1019,7 +1019,9 @@ void TQueueLeader::OnLoadStdMessageResult(const TString& requestId, const ui64 o
10191019
RLOG_SQS_REQ_WARN(requestId, "Attempted to receive message that was deleted. Shard: " << reqInfo.GetCurrentShard() << ". Offset: " << offset);
10201020
deleted = true;
10211021
}
1022-
} // else there was concurrent delete (purge) by this leader, => OK
1022+
} else { // else there was concurrent delete (purge) by this leader, => OK
1023+
deleted = true;
1024+
}
10231025
}
10241026
const bool invalidated = deleted || deadlineChanged;
10251027
if (invalidated) {
@@ -1028,7 +1030,7 @@ void TQueueLeader::OnLoadStdMessageResult(const TString& requestId, const ui64 o
10281030
const TString& reason = deleted ? INFLY_INVALIDATION_REASON_DELETED : INFLY_INVALIDATION_REASON_DEADLINE_CHANGED;
10291031
MarkInflyReloading(reqInfo.GetCurrentShard(), 1, reason);
10301032
}
1031-
} else {
1033+
} else { // if (success)
10321034
reqInfo.LoadError = !ignoreMessageLoadingErrors;
10331035
// there may be other successful loads
10341036
}

0 commit comments

Comments
 (0)