[fix](frontend) fix notify update storage policy agent task null exception #12470
This commit is contained in:
@ -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.");
|
||||
|
||||
@ -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;
|
||||
|
||||
Reference in New Issue
Block a user