chia7712 commented on code in PR #15637:
URL: https://github.com/apache/kafka/pull/15637#discussion_r1545997106
##########
core/src/main/scala/kafka/cluster/Partition.scala:
##########
@@ -877,9 +877,8 @@ class Partition(val topicPartition: TopicPartition,
if (logManager.onlineLogDirId(directoryId) ||
!logManager.hasOfflineLogDirs() || directoryId == DirectoryId.UNASSIGNED) {
createLogIfNotExists(partitionState.isNew, isFutureReplica = false,
highWatermarkCheckpoints, topicId, targetLogDirectoryId)
} else {
- warn(s"Skipping creation of log because there are potentially
offline log " +
- s"directories and log may already exist there.
directoryId=$directoryId, " +
- s"topicId=$topicId, targetLogDirectoryId=$targetLogDirectoryId")
+ throw new KafkaStorageException(s"Skipping creation of log because
there are potentially offline log " +
Review Comment:
After fixing the race condition, the metadata event thread does not recreate
the log. Hence, we have to throw `KafkaStorageException` to avoid
`NotLeaderOrFollowerException`
(https://github.com/apache/kafka/blob/trunk/core/src/main/scala/kafka/cluster/Partition.scala#L751)
--
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]