From 040a2102a97df40e74877d245cbcba8e667a4445 Mon Sep 17 00:00:00 2001 From: Ray Mattingly Date: Mon, 2 Sep 2024 04:15:13 -0400 Subject: [PATCH] HBASE-28643 An unbounded backup failure message can cause an irrecoverable state for the given backup (#6088) Co-authored-by: Ray Mattingly Signed-off-by: Nick Dimiduk --- .../main/java/org/apache/hadoop/hbase/backup/BackupInfo.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java index 1fad5b6cfdb1..5a0094740d63 100644 --- a/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java +++ b/hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java @@ -44,6 +44,7 @@ @InterfaceAudience.Private public class BackupInfo implements Comparable { private static final Logger LOG = LoggerFactory.getLogger(BackupInfo.class); + private static final int MAX_FAILED_MESSAGE_LENGTH = 1024; public interface Filter { /** @@ -266,6 +267,9 @@ public String getFailedMsg() { } public void setFailedMsg(String failedMsg) { + if (failedMsg.length() > MAX_FAILED_MESSAGE_LENGTH) { + failedMsg = failedMsg.substring(0, MAX_FAILED_MESSAGE_LENGTH); + } this.failedMsg = failedMsg; }