Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions be/src/agent/task_worker_pool.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1593,23 +1593,15 @@ void update_s3_resource(const TStorageResource& param, io::RemoteFileSystemSPtr
DCHECK_EQ(existed_fs->type(), io::FileSystemType::S3) << param.id << ' ' << param.name;
auto client = static_cast<io::S3FileSystem*>(existed_fs.get())->client_holder();
auto new_s3_conf = S3Conf::get_s3_conf(param.s3_storage_param);
S3ClientConf conf {
.endpoint {},
.region {},
.ak = std::move(new_s3_conf.client_conf.ak),
.sk = std::move(new_s3_conf.client_conf.sk),
.token = std::move(new_s3_conf.client_conf.token),
.bucket {},
.provider = new_s3_conf.client_conf.provider,
};
S3ClientConf conf = std::move(new_s3_conf.client_conf);
st = client->reset(conf);
fs = std::move(existed_fs);
}

if (!st.ok()) {
LOG(WARNING) << "update s3 resource failed: " << st;
} else {
LOG_INFO("successfully update hdfs resource")
LOG_INFO("successfully update s3 resource")
.tag("resource_id", param.id)
.tag("resource_name", param.name);
put_storage_resource(param.id, {std::move(fs)}, param.version);
Expand Down
6 changes: 4 additions & 2 deletions be/src/io/fs/s3_file_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,7 @@ Status ObjClientHolder::reset(const S3ClientConf& conf) {
S3ClientConf reset_conf;
{
std::shared_lock lock(_mtx);
if (conf.ak == _conf.ak && conf.sk == _conf.sk && conf.token == _conf.token &&
conf.use_virtual_addressing == _conf.use_virtual_addressing) {
if (conf.get_hash() == _conf.get_hash()) {
return Status::OK(); // Same conf
}

Expand All @@ -96,6 +95,9 @@ Status ObjClientHolder::reset(const S3ClientConf& conf) {
reset_conf.sk = conf.sk;
reset_conf.token = conf.token;
reset_conf.bucket = conf.bucket;
reset_conf.connect_timeout_ms = conf.connect_timeout_ms;
reset_conf.max_connections = conf.max_connections;
reset_conf.request_timeout_ms = conf.request_timeout_ms;
reset_conf.use_virtual_addressing = conf.use_virtual_addressing;

reset_conf.role_arn = conf.role_arn;
Expand Down
Loading