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

优化判断节点是否存在算法 #1777

Closed
felixncheng opened this issue Feb 20, 2024 · 0 comments
Closed

优化判断节点是否存在算法 #1777

felixncheng opened this issue Feb 20, 2024 · 0 comments
Assignees
Labels
done enhancement New feature or request for test

Comments

@felixncheng
Copy link
Collaborator

在物理删除文件时,为了保证不误删,需要对文件进行二次确认,现在采取的是遍历的方式判断文件是否存在,这样数据量巨大的时,效率十分低下,且对数据库产生很大压力。

优化手段

可以使用布隆过滤器,来快速判断文件是否存在。根据布隆过滤器的原理,可以得知它存在误算,这里误算是指本不存在的元素,被判断存在了。误算在我们这个场景中,可以容忍,我们害怕的是误删,而不是多保留,当然也要考虑如何降低误算率。

@felixncheng felixncheng added enhancement New feature or request backlog labels Feb 20, 2024
@felixncheng felixncheng self-assigned this Feb 20, 2024
@bkci-bot bkci-bot added for test and removed backlog labels Feb 20, 2024
felixncheng added a commit to felixncheng/bk-repo that referenced this issue Feb 21, 2024
owenlxu pushed a commit that referenced this issue Feb 29, 2024
* impr: 优化清理引用任务中的节点判存逻辑 #1777

* #impr: 补充单元测试 #1777
@bkci-bot bkci-bot closed this as completed Mar 7, 2024
@bkci-bot bkci-bot added for test and removed for test labels Mar 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
done enhancement New feature or request for test
Projects
None yet
Development

No branches or pull requests

2 participants