mwesterby commented on code in PR #15733:
URL: https://github.com/apache/kafka/pull/15733#discussion_r1567721679
##########
core/src/main/scala/kafka/tools/StorageTool.scala:
##########
@@ -440,8 +440,12 @@ object StorageTool extends Logging {
"Use --ignore-formatted to ignore this directory and format the
others.")
}
if (!copier.errorLogDirs().isEmpty) {
- val firstLogDir = copier.errorLogDirs().iterator().next()
- throw new TerseFailure(s"I/O error trying to read log directory
$firstLogDir.")
+ copier.errorLogDirs().forEach(errorLogDir => {
+ stream.println(s"I/O error trying to read log directory $errorLogDir.
Ignoring...")
+ })
+ if(metaPropertiesEnsemble.emptyLogDirs().isEmpty) {
+ throw new TerseFailure("No available log directories to format.")
Review Comment:
Discussed below. I've now added the additional check to see if `logDirProps`
is empty, and only throw this failure when this is also true. This is to
prevent the format storage script from failing when then only remaining
directories to be formatted are unavailable, but there is at least one
directory already formatted, and the script is ran with `--ignore-formatted`.
In this scenario, it should succeed as there is at least one successfully
formatted directory.
--
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]