You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by mo...@apache.org on 2025/10/17 03:52:35 UTC
(doris) branch branch-3.1 updated: branch-3.1: [Fix](Repository)Handle non-StorageException errors in Storage parameter validation #56929 (#57014)
This is an automated email from the ASF dual-hosted git repository.
morrysnow pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/doris.git
The following commit(s) were added to refs/heads/branch-3.1 by this push:
new 0a91a31ee9c branch-3.1: [Fix](Repository)Handle non-StorageException errors in Storage parameter validation #56929 (#57014)
0a91a31ee9c is described below
commit 0a91a31ee9c736ab00b5849f8869b7de9e70ddff
Author: github-actions[bot] <41...@users.noreply.github.com>
AuthorDate: Fri Oct 17 11:52:28 2025 +0800
branch-3.1: [Fix](Repository)Handle non-StorageException errors in Storage parameter validation #56929 (#57014)
Cherry-picked from #56929
---------
Co-authored-by: Calvin Kirs <gu...@selectdb.com>
Co-authored-by: Mingyu Chen (Rayner) <yu...@selectdb.com>
---
.../java/org/apache/doris/backup/Repository.java | 17 +++++++-----
.../org/apache/doris/backup/BackupHandlerTest.java | 32 ----------------------
2 files changed, 10 insertions(+), 39 deletions(-)
diff --git a/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java b/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java
index 04aa01635c8..e50de93bf3b 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/backup/Repository.java
@@ -30,9 +30,7 @@ import org.apache.doris.common.io.Text;
import org.apache.doris.common.io.Writable;
import org.apache.doris.common.util.PrintableMap;
import org.apache.doris.common.util.TimeUtils;
-import org.apache.doris.datasource.property.storage.BrokerProperties;
import org.apache.doris.datasource.property.storage.StorageProperties;
-import org.apache.doris.datasource.property.storage.exception.StoragePropertiesException;
import org.apache.doris.fs.FileSystemFactory;
import org.apache.doris.fs.PersistentFileSystem;
import org.apache.doris.fs.remote.BrokerFileSystem;
@@ -48,6 +46,7 @@ import com.google.common.base.Strings;
import com.google.common.collect.Lists;
import com.google.gson.annotations.SerializedName;
import org.apache.commons.codec.digest.DigestUtils;
+import org.apache.commons.lang3.exception.ExceptionUtils;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import org.json.simple.JSONObject;
@@ -211,11 +210,15 @@ public class Repository implements Writable, GsonPostProcessable {
try {
StorageProperties storageProperties = StorageProperties.createPrimary(this.fileSystem.properties);
this.fileSystem = FileSystemFactory.get(storageProperties);
- } catch (StoragePropertiesException exception) {
- LOG.warn("Failed to create file system for repository: {}, error: {}, roll back to broker"
- + " filesystem", name, exception.getMessage());
- BrokerProperties brokerProperties = BrokerProperties.of(this.fileSystem.name, this.fileSystem.properties);
- this.fileSystem = FileSystemFactory.get(brokerProperties);
+ } catch (RuntimeException exception) {
+ LOG.warn("Failed to create file system from properties, error msg {}",
+ ExceptionUtils.getRootCause(exception), exception);
+ throw new IllegalStateException(
+ "Failed to initialize file system due to incompatible configuration with the current version. "
+ + "This may be caused by a change in property formats or deprecated settings. "
+ + "Please verify your configuration and ensure it matches the "
+ + "new version requirements. error msg: "
+ + ExceptionUtils.getRootCause(exception), exception);
}
}
diff --git a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
index 2407eff6747..90c952903ca 100644
--- a/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
+++ b/fe/fe-core/src/test/java/org/apache/doris/backup/BackupHandlerTest.java
@@ -63,11 +63,7 @@ import org.junit.Assert;
import org.junit.Before;
import org.junit.Test;
-import java.io.DataInputStream;
-import java.io.DataOutputStream;
import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
import java.io.IOException;
import java.nio.file.FileVisitOption;
import java.nio.file.Files;
@@ -280,20 +276,6 @@ public class BackupHandlerTest {
request.setTaskStatus(new TStatus(TStatusCode.OK));
handler.handleFinishedSnapshotUploadTask(uploadTask, request);
- // test file persist
- File tmpFile = new File("./tmp" + System.currentTimeMillis());
- try {
- DataOutputStream out = new DataOutputStream(new FileOutputStream(tmpFile));
- handler.write(out);
- out.flush();
- out.close();
- DataInputStream in = new DataInputStream(new FileInputStream(tmpFile));
- BackupHandler.read(in);
- in.close();
- } finally {
- tmpFile.delete();
- }
-
// cancel backup
handler.cancel(new CancelBackupStmt(CatalogMocker.TEST_DB_NAME, false));
@@ -335,20 +317,6 @@ public class BackupHandlerTest {
request.setTaskStatus(new TStatus(TStatusCode.OK));
handler.handleDirMoveTask(dirMoveTask, request);
- // test file persist
- tmpFile = new File("./tmp" + System.currentTimeMillis());
- try {
- DataOutputStream out = new DataOutputStream(new FileOutputStream(tmpFile));
- handler.write(out);
- out.flush();
- out.close();
- DataInputStream in = new DataInputStream(new FileInputStream(tmpFile));
- BackupHandler.read(in);
- in.close();
- } finally {
- tmpFile.delete();
- }
-
// cancel restore
handler.cancel(new CancelBackupStmt(CatalogMocker.TEST_DB_NAME, true));
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org