-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: TCloud负载均衡同步优化 #1147
base: feat-loadbalancer
Are you sure you want to change the base?
feat: TCloud负载均衡同步优化 #1147
Conversation
} | ||
|
||
allCloudIDMap := make(map[string]struct{}, 1024) | ||
for { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
顺序需要调整,目前会存在两个问题:
- 如果等整个region同步完,再去删除本地的数据,时间会比较久,在这中间用户新增加的本地数据,会被删除;
- Next完就需要去删除本地数据,最后再去统一的Sync,不然在执行Sync方法时,可能会存在一些唯一性校验的内容,由于没有先把region下需要删除的资源删掉,导致添加或者更新不进来。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
如果是这样的话,
- 缓存全部云上clb列表(约几万个长度的实例列表)
- 重新拉一次云上数据(双倍时间)
} | ||
for _, idBatch := range slice.Split(delCloudIDs, constant.BatchOperationMaxLimit) { | ||
if err := cli.deleteLoadBalancer(kt, params.AccountID, params.Region, idBatch); err != nil { | ||
logs.Errorf("fail to delete removed clb, err: %s, account: %s, region: %s, cloudIds: %v, rid: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"err: %v"
if params.CloudIDs[i] == lbFromCloud[i].GetCloudID() { | ||
continue | ||
} | ||
logs.Warnf("params.CloudIDs[%d] mismatch prefetched lb cloud id, params: %s, opt: %s, rid: %s", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"params: %s, opt: %s"
这里只打印了云ID吧?这里叫params、opt感觉不太合适
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
params,opt 是简写,打出来的是对应的 cloud id ,不然太长了
cmd/hc-service/logics/res-sync/tcloud/load_balancer_listener.go
Outdated
Show resolved
Hide resolved
--story=120462150 腾讯云 ClientError.NetworkError 错误重试
ba80aa2
to
ec90ac7
Compare
ec90ac7
to
f29371a
Compare
No description provided.