Skip to content

Commit 5aa7390

Browse files
rmdmattinglyRay Mattingly
authored andcommitted
HBASE-28643 An unbounded backup failure message can cause an irrecoverable state for the given backup (#6088)
Co-authored-by: Ray Mattingly <rmattingly@hubspot.com> Signed-off-by: Nick Dimiduk <ndimiduk@apache.org>
1 parent d852cc2 commit 5aa7390

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

hbase-backup/src/main/java/org/apache/hadoop/hbase/backup/BackupInfo.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
@InterfaceAudience.Private
4545
public class BackupInfo implements Comparable<BackupInfo> {
4646
private static final Logger LOG = LoggerFactory.getLogger(BackupInfo.class);
47+
private static final int MAX_FAILED_MESSAGE_LENGTH = 1024;
4748

4849
public interface Filter {
4950
/**
@@ -266,6 +267,9 @@ public String getFailedMsg() {
266267
}
267268

268269
public void setFailedMsg(String failedMsg) {
270+
if (failedMsg.length() > MAX_FAILED_MESSAGE_LENGTH) {
271+
failedMsg = failedMsg.substring(0, MAX_FAILED_MESSAGE_LENGTH);
272+
}
269273
this.failedMsg = failedMsg;
270274
}
271275

0 commit comments

Comments
 (0)