This is an automated email from the ASF dual-hosted git repository.

dataroaring pushed a commit to branch branch-3.0
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-3.0 by this push:
     new a1d5291c2a0 branch-3.0: [chore](storage vault) Make 
CacheHotspotManager exception msg more distinct #51861 (#52136)
a1d5291c2a0 is described below

commit a1d5291c2a091984b57750b3c5e7ebbf6e85205d
Author: github-actions[bot] 
<41898282+github-actions[bot]@users.noreply.github.com>
AuthorDate: Mon Jun 23 21:52:42 2025 +0800

    branch-3.0: [chore](storage vault) Make CacheHotspotManager exception msg 
more distinct #51861 (#52136)
    
    Cherry-picked from #51861
    
    Co-authored-by: Lei Zhang <zhang...@selectdb.com>
---
 .../src/main/java/org/apache/doris/cloud/CacheHotspotManager.java | 6 +++++-
 .../java/org/apache/doris/cloud/CacheHotspotManagerUtils.java     | 4 ++++
 .../main/java/org/apache/doris/common/util/PropertyAnalyzer.java  | 2 +-
 regression-test/suites/vault_p0/alter/test_alter_s3_vault.groovy  | 5 ++++-
 .../vault_p0/concurent/test_create_vault_concurrently.groovy      | 8 ++++----
 5 files changed, 18 insertions(+), 7 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java 
b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
index a05518a6ee2..1e86fda15db 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManager.java
@@ -124,12 +124,16 @@ public class CacheHotspotManager extends MasterDaemon {
             jobDaemon.start();
             startJobDaemon = true;
         }
+
         if (!tableCreated) {
             try {
                 CacheHotspotManagerUtils.execCreateCacheTable();
                 tableCreated = true;
+                this.intervalMs = 
Config.fetch_cluster_cache_hotspot_interval_ms;
             } catch (Exception e) {
-                LOG.warn("Create cache hot spot table failed", e);
+                // sleep 60s wait for syncing storage vault info from ms and 
retry
+                this.intervalMs = 60000;
+                LOG.warn("Create cache hot spot table failed, sleep 60s and 
retry", e);
                 return;
             }
         }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManagerUtils.java 
b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManagerUtils.java
index ed2213e1208..cd295d9707b 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManagerUtils.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/cloud/CacheHotspotManagerUtils.java
@@ -216,11 +216,15 @@ public class CacheHotspotManagerUtils {
         Database db = 
Env.getCurrentInternalCatalog().getDbNullable(FeConstants.INTERNAL_DB_NAME);
         if (db == null) {
             LOG.warn("{} database doesn't exist", 
FeConstants.INTERNAL_DB_NAME);
+            throw new Exception(
+                    String.format("Database %s doesn't exist", 
FeConstants.INTERNAL_DB_NAME));
         }
 
         Table t = 
db.getTableNullable(FeConstants.INTERNAL_FILE_CACHE_HOTSPOT_TABLE_NAME);
         if (t == null) {
             LOG.warn("{} table doesn't exist", 
FeConstants.INTERNAL_FILE_CACHE_HOTSPOT_TABLE_NAME);
+            throw new Exception(
+                    String.format("Table %s doesn't exist", 
FeConstants.INTERNAL_FILE_CACHE_HOTSPOT_TABLE_NAME));
         }
         INTERNAL_TABLE_ID = String.valueOf(t.getId());
     }
diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
index 1c12d2b106b..b873cd8e7cf 100644
--- 
a/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
+++ 
b/fe/fe-core/src/main/java/org/apache/doris/common/util/PropertyAnalyzer.java
@@ -1236,7 +1236,7 @@ public class PropertyAnalyzer {
             } else {
                 // continue to check default vault
                 Pair<String, String> info = 
Env.getCurrentEnv().getStorageVaultMgr().getDefaultStorageVault();
-                if (info == null) {
+                if (info == null || Strings.isNullOrEmpty(info.first) || 
Strings.isNullOrEmpty(info.second)) {
                     throw new AnalysisException("No default storage vault."
                             + " You can use `SHOW STORAGE VAULT` to get all 
available vaults,"
                             + " and pick one set default vault with `SET 
<vault_name> AS DEFAULT STORAGE VAULT`");
diff --git a/regression-test/suites/vault_p0/alter/test_alter_s3_vault.groovy 
b/regression-test/suites/vault_p0/alter/test_alter_s3_vault.groovy
index b9d6d1975cf..f20bdafef57 100644
--- a/regression-test/suites/vault_p0/alter/test_alter_s3_vault.groovy
+++ b/regression-test/suites/vault_p0/alter/test_alter_s3_vault.groovy
@@ -203,8 +203,11 @@ suite("test_alter_s3_vault", "nonConcurrent") {
     for (int i = 0; i < vaultInfos.size(); i++) {
         logger.info("vault info: ${vaultInfos[i]}")
         if (vaultInfos[i][0].equals(s3VaultName)) {
+            // [s3_9f2c2f80a45c4fb48ad901f70675ffdf, 8, ctime: 1750217403 
mtime: 1750217404 ak: "*******" sk: "xxxxxxx" bucket: "xxx" ...]
             def newProperties = vaultInfos[i][2]
-            assertTrue(properties.equals(newProperties), "Properties are not 
the same")
+            def oldAkSkStr = properties.substring(properties.indexOf("ak:") + 
3, properties.indexOf("bucket:") - 1)
+            def newAkSkStr = 
newProperties.substring(newProperties.indexOf("ak:") + 3, 
newProperties.indexOf("bucket:") - 1)
+            assertTrue(oldAkSkStr.equals(newAkSkStr), "Ak and Sk string are 
not the same")
         }
     }
 
diff --git 
a/regression-test/suites/vault_p0/concurent/test_create_vault_concurrently.groovy
 
b/regression-test/suites/vault_p0/concurent/test_create_vault_concurrently.groovy
index 985bf971e3a..86b01474c7d 100644
--- 
a/regression-test/suites/vault_p0/concurent/test_create_vault_concurrently.groovy
+++ 
b/regression-test/suites/vault_p0/concurent/test_create_vault_concurrently.groovy
@@ -35,7 +35,7 @@ suite("test_create_vault_concurrently", "nonConcurrent") {
 
     def future1 = thread("threadName1") {
         for (int i = 0; i < 100; i++) {
-            sql """
+            try_sql """
                 CREATE STORAGE VAULT IF NOT EXISTS ${s3VaultName}
                 PROPERTIES (
                     "type"="S3",
@@ -55,7 +55,7 @@ suite("test_create_vault_concurrently", "nonConcurrent") {
 
     def future2 = thread("threadName2") {
         for (int i = 0; i < 100; i++) {
-            sql """
+            try_sql """
                 CREATE STORAGE VAULT IF NOT EXISTS ${s3VaultName}
                 PROPERTIES (
                     "type"="S3",
@@ -75,7 +75,7 @@ suite("test_create_vault_concurrently", "nonConcurrent") {
 
     def future3 = thread("threadName3") {
         for (int i = 0; i < 100; i++) {
-            sql """
+            try_sql """
                 CREATE STORAGE VAULT IF NOT EXISTS ${s3VaultName}
                 PROPERTIES (
                     "type"="S3",
@@ -95,7 +95,7 @@ suite("test_create_vault_concurrently", "nonConcurrent") {
 
     def future4 = thread("threadName4") {
         for (int i = 0; i < 100; i++) {
-            sql """
+            try_sql """
                 CREATE STORAGE VAULT IF NOT EXISTS ${s3VaultName}
                 PROPERTIES (
                     "type"="S3",


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org
For additional commands, e-mail: commits-h...@doris.apache.org

Reply via email to