danny0405 commented on code in PR #18816:
URL: https://github.com/apache/hudi/pull/18816#discussion_r3910689180
##########
hudi-cli/src/main/java/org/apache/hudi/cli/commands/RepairsCommand.java:
##########
@@ -201,7 +202,12 @@ public void removeCorruptedPendingCleanAction() {
TimelineUtils.deleteInstantFile(client.getStorage(),
client.getTimelinePath(),
instant, client.getInstantFileNameGenerator());
} catch (IOException ioe) {
- if (ioe.getMessage().contains("Not an Avro data file")) {
+ // An empty or truncated instant file does not reach Avro's magic-byte
check; the timeline
+ // reader reports it as "unable to read commit metadata" instead,
capitalised by the v1
+ // serde and lowercase by the v2 one, hence the case-insensitive match.
+ if (ioe.getMessage() != null
+ && (ioe.getMessage().contains("Not an Avro data file")
+ || ioe.getMessage().toLowerCase(Locale.ROOT).contains("unable
to read commit metadata"))) {
Review Comment:
[P1] Do not delete a clean plan based on the serde wrapper message
This still classifies any failure wrapped by
`CommitMetadataSerDeV1/V2.deserialize` as corruption: both serdes catch
arbitrary exceptions (including storage timeouts while reading a valid plan)
and rethrow `[Uu]nable to read commit metadata ...`. The condition therefore
deletes a healthy pending clean instant after a transient read failure. I
reproduced this with a valid serialized `HoodieCleanerPlan` and an injected
`SocketTimeoutException`; this branch reached `deleteInstantFile`. Please
verify deterministic empty/corrupt content before deleting (for example, read
the bytes successfully and then deserialize), propagate storage I/O failures,
and add a regression test proving a timeout does not remove the instant.
--
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]