Skip to content

Commit

Permalink
[CONTROLLER/RECORDER] fixes cleaning pod bug
Browse files Browse the repository at this point in the history
  • Loading branch information
zhengya authored and SongZhen0704 committed Jun 21, 2024
1 parent 8c58c3d commit 673cf37
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
4 changes: 1 addition & 3 deletions server/controller/recorder/cache/tool/data_set.go
Original file line number Diff line number Diff line change
Expand Up @@ -2113,10 +2113,8 @@ func (t *DataSet) GetVMIDByPodNodeID(podNodeID int) (int, bool) {
if result.RowsAffected == 1 {
t.AddVMPodNodeConnection(&conn)
return conn.VMID, true
} else {
log.Error(t.metadata.Logf("db %s (%s id: %d) not found", ctrlrcommon.RESOURCE_TYPE_VM_POD_NODE_CONNECTION_EN, ctrlrcommon.RESOURCE_TYPE_POD_NODE_EN, podNodeID))
return 0, false
}
return 0, false
}

func (t *DataSet) GetPodNodeIDByVMPodNodeConnectionLcuuid(lcuuid string) (int, bool) {
Expand Down
2 changes: 1 addition & 1 deletion server/controller/recorder/cleaner.go
Original file line number Diff line number Diff line change
Expand Up @@ -400,7 +400,7 @@ func (c *Cleaner) cleanPodNodeDirty() {
}

var pods []*mysql.Pod
c.org.DB.Where("pod_node_id NOT IN ?", podNodeIDs).Find(&pods)
c.org.DB.Where("pod_node_id != 0 AND pod_node_id NOT IN ?", podNodeIDs).Find(&pods)
if len(pods) != 0 {
c.org.DB.Delete(&pods)
publishTagrecorder(c.org.DB, pods, ctrlrcommon.RESOURCE_TYPE_POD_EN, c.toolData)
Expand Down

0 comments on commit 673cf37

Please sign in to comment.