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

yiguolei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/master by this push:
     new b98a3ed86c [fix](frontend) fix notify update storage policy agent task 
null exception #12470
b98a3ed86c is described below

commit b98a3ed86ca753d430047be287c8056f920c8fc2
Author: deardeng <[email protected]>
AuthorDate: Tue Sep 13 16:20:11 2022 +0800

    [fix](frontend) fix notify update storage policy agent task null exception 
#12470
---
 .../src/main/java/org/apache/doris/policy/StoragePolicy.java   |  7 ++-----
 .../src/main/java/org/apache/doris/task/AgentBatchTask.java    | 10 ++++++++++
 2 files changed, 12 insertions(+), 5 deletions(-)

diff --git 
a/fe/fe-core/src/main/java/org/apache/doris/policy/StoragePolicy.java 
b/fe/fe-core/src/main/java/org/apache/doris/policy/StoragePolicy.java
index 1200745c52..653052cd59 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/policy/StoragePolicy.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/policy/StoragePolicy.java
@@ -181,11 +181,8 @@ public class StoragePolicy extends Policy {
         }
         if (props.containsKey(COOLDOWN_TTL)) {
             hasCooldownTtl = true;
-            if (Integer.parseInt(props.get(COOLDOWN_TTL)) < 0) {
-                throw new AnalysisException("cooldown_ttl must >= 0.");
-            }
-            this.cooldownTtl = props.get(COOLDOWN_TTL);
-            this.cooldownTtlMs = getMsByCooldownTtl(this.cooldownTtl);
+            // second
+            this.cooldownTtl = 
String.valueOf(getMsByCooldownTtl(props.get(COOLDOWN_TTL)) / 1000);
         }
         if (hasCooldownDatetime && hasCooldownTtl) {
             throw new AnalysisException(COOLDOWN_DATETIME + " and " + 
COOLDOWN_TTL + " can't be set together.");
diff --git a/fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java 
b/fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java
index 20e5c3b5df..2319bf8886 100644
--- a/fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java
+++ b/fe/fe-core/src/main/java/org/apache/doris/task/AgentBatchTask.java
@@ -33,6 +33,7 @@ import org.apache.doris.thrift.TCompactionReq;
 import org.apache.doris.thrift.TCreateTabletReq;
 import org.apache.doris.thrift.TDownloadReq;
 import org.apache.doris.thrift.TDropTabletReq;
+import org.apache.doris.thrift.TGetStoragePolicy;
 import org.apache.doris.thrift.TMoveDirReq;
 import org.apache.doris.thrift.TNetworkAddress;
 import org.apache.doris.thrift.TPublishVersionRequest;
@@ -349,6 +350,15 @@ public class AgentBatchTask implements Runnable {
                 tAgentTaskRequest.setCompactionReq(request);
                 return tAgentTaskRequest;
             }
+            case NOTIFY_UPDATE_STORAGE_POLICY: {
+                NotifyUpdateStoragePolicyTask notifyUpdateStoragePolicyTask = 
(NotifyUpdateStoragePolicyTask) task;
+                TGetStoragePolicy request = 
notifyUpdateStoragePolicyTask.toThrift();
+                if (LOG.isDebugEnabled()) {
+                    LOG.debug(request.toString());
+                }
+                tAgentTaskRequest.setUpdatePolicy(request);
+                return tAgentTaskRequest;
+            }
             default:
                 LOG.debug("could not find task type for task [{}]", task);
                 return null;


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to