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

fix: data under all organizations should be cleared when disk is full #7565

Merged
merged 2 commits into from
Jul 25, 2024
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
5 changes: 4 additions & 1 deletion server/ingester/ckmonitor/monitor.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import (

"github.com/deepflowio/deepflow/server/ingester/common"
"github.com/deepflowio/deepflow/server/ingester/config"
"github.com/deepflowio/deepflow/server/libs/ckdb"
"github.com/deepflowio/deepflow/server/libs/codec"
"github.com/deepflowio/deepflow/server/libs/stats"
"github.com/deepflowio/deepflow/server/libs/stats/pb"
Expand Down Expand Up @@ -208,7 +209,9 @@ func (m *Monitor) isDisksNeedClean(diskInfo *DiskInfo) bool {

func (m *Monitor) isPriorityDrop(database, table string) bool {
for _, priorityDrop := range m.cfg.CKDiskMonitor.PriorityDrops {
if database == priorityDrop.Database {
if database == priorityDrop.Database ||
// this database under all organizations needs to be cleaned
(len(database) > ckdb.ORG_ID_PREFIX_LEN && (database[ckdb.ORG_ID_PREFIX_LEN:] == priorityDrop.Database)) {
if priorityDrop.TablesContain == "" {
return true
}
Expand Down
2 changes: 1 addition & 1 deletion server/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -623,7 +623,7 @@ ingester:
# free-space: 300 # uint: GB, disk minimum free threshold
# used-space: 0 # uint: GB, disk maximum usage space threshold. (If it is 0, it means ignore the condition)
# priority-drops: # set which database and table data will be deleted first when disk is full
# - database: flow_log
# - database: flow_log # databases under all organizations
# tables-contain: # tables name containing the string will be priority-dropped. If it is empty, it means all the tables under the database
# - database: flow_metrics
# tables-contain: 1s_local
Expand Down
Loading