platoneko commented on code in PR #35473: URL: https://github.com/apache/doris/pull/35473#discussion_r1616633056
########## be/src/agent/task_worker_pool.cpp: ########## @@ -1462,16 +1462,20 @@ void push_storage_policy_callback(StorageEngine& engine, const TAgentTaskRequest const auto& push_storage_policy_req = req.push_storage_policy_req; // refresh resource for (auto&& param : push_storage_policy_req.resource) { - auto existed_resource = get_storage_resource(param.id); - if (existed_resource.version >= param.version) { - // Stale request, ignore - continue; + io::RemoteFileSystemSPtr fs; + if (auto existed_resource = get_storage_resource(param.id); existed_resource) { + if (existed_resource->second >= param.version) { + // Stale request, ignore + continue; + } + + fs = std::move(existed_resource->first.fs); } if (param.__isset.s3_storage_param) { - update_s3_resource(param, std::move(existed_resource.fs)); + update_s3_resource(param, std::move(fs)); Review Comment: `existed_resource` 来自 `put_storage_resource`,一般来说不会有空的被 put 进去,不过想保险也可以给 `put_storage_resource` 加个毒性检查 -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org