jolshan commented on code in PR #14568:
URL: https://github.com/apache/kafka/pull/14568#discussion_r1364172007
##########
core/src/main/scala/kafka/log/UnifiedLog.scala:
##########
@@ -1080,9 +1080,9 @@ class UnifiedLog(@volatile var logStartOffset: Long,
(updatedProducers, completedTxns.toList, None)
}
- private def batchMissingRequiredVerification(batch: MutableRecordBatch,
requestVerificationGuard: Object): Boolean = {
+ private def batchMissingRequiredVerification(batch: MutableRecordBatch,
requestVerificationGuard: VerificationGuard): Boolean = {
producerStateManager.producerStateManagerConfig().transactionVerificationEnabled()
&& !batch.isControlBatch &&
- (requestVerificationGuard != verificationGuard(batch.producerId) ||
requestVerificationGuard == null)
+ (requestVerificationGuard == null ||
!requestVerificationGuard.equals(verificationGuard(batch.producerId)))
Review Comment:
I've updated the code to include the sentinel. We still need to check if the
requestVerificationGuard is the sentinel for the case where we enable
verification when the request is at the log layer (ie, past the point where we
would have made the api call) Without that check, we will get both verification
guards as the sentinel and they will be equal.
Alternatively, I can have some methods return null if the verification guard
is missing. But that may get confusing.
--
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]