Skip to content
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

Add batch clean instances maintian interface #784

Merged

Conversation

shichaoyuan
Copy link
Member

Please provide issue(s) of this PR:
Fixes https://github.com/polarismesh/polaris-cleanup/issues/2
为了移除 cleanup 项目对 store 的直接依赖,在 polaris-server 中新增一个批量清除软删除实例的运维接口

To help us figure out who should review this PR, please put an X in all the areas that this PR affects.

  • Configuration
  • Docs
  • Installation
  • Performance and Scalability
  • Naming
  • HealthCheck
  • Test and Release

Please check any characteristics that apply to this pull request.

  • Does not have any user-facing changes. This may include API changes, behavior changes, performance improvements, etc.

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #784 (8b69b38) into main (74ddd88) will decrease coverage by 0.06%.
The diff coverage is 44.92%.

@@            Coverage Diff             @@
##             main     #784      +/-   ##
==========================================
- Coverage   57.11%   57.04%   -0.07%     
==========================================
  Files         159      161       +2     
  Lines       28805    28850      +45     
==========================================
+ Hits        16451    16458       +7     
- Misses      10155    10185      +30     
- Partials     2199     2207       +8     
Impacted Files Coverage Δ
store/boltdb/circuitbreaker.go 65.76% <0.00%> (ø)
store/boltdb/config_file_tag.go 75.75% <0.00%> (ø)
store/boltdb/group.go 58.53% <0.00%> (ø)
store/boltdb/instance.go 63.02% <0.00%> (ø)
store/boltdb/namespace.go 69.33% <0.00%> (ø)
store/boltdb/service.go 55.94% <0.00%> (ø)
store/boltdb/strategy.go 53.56% <0.00%> (ø)
store/sqldb/maintian.go 0.00% <0.00%> (ø)
store/boltdb/default.go 59.32% <57.14%> (-0.09%) ⬇️
store/boltdb/handler.go 63.22% <66.66%> (-0.46%) ⬇️
... and 11 more

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@chuntaojun
Copy link
Member

单元测试没有过,看看问题修复下

@chuntaojun chuntaojun added the service Service registration discovery, service governance label Nov 7, 2022
@@ -23,5 +23,5 @@ type maintainStore struct {

// BatchCleanDeletedInstances
func (m *maintainStore) BatchCleanDeletedInstances(batchSize uint32) (uint32, error) {
return 0, nil
return m.handler.BatchDeleteInvalidValues(tblNameInstance, batchSize)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

更合理的方式是不是应该用 m.handler 先 loadByilter 一把,然后在删除?不应该吧逻辑写在BoltDB的封装里面,不然太强要求Valid属性

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

有道理,我改下

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

其他我看应该没什么问题了,这个修改下就好

@chuntaojun chuntaojun merged commit 481935e into polarismesh:main Nov 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
service Service registration discovery, service governance
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants