DNS节点检查是否需要升级时,加入集群是否可用的条件

This commit is contained in:
GoEdgeLab
2021-07-06 10:27:14 +08:00
parent 3a524ebc0d
commit 7ffa4c3cf9
2 changed files with 2 additions and 1 deletions

View File

@@ -22,5 +22,5 @@ const (
UserNodeVersion = "0.0.9"
AuthorityNodeVersion = "0.0.2"
MonitorNodeVersion = "0.0.2"
DNSNodeVersion = "0.0.1"
DNSNodeVersion = "0.0.2"
)

View File

@@ -335,6 +335,7 @@ func (this NSNodeDAO) UpdateNodeStatus(tx *dbs.Tx, nodeId int64, statusJSON []by
func (this *NSNodeDAO) CountAllLowerVersionNodes(tx *dbs.Tx, version string) (int64, error) {
return this.Query(tx).
State(NSNodeStateEnabled).
Where("clusterId IN (SELECT id FROM "+SharedNSClusterDAO.Table+" WHERE state=1)").
Where("status IS NOT NULL").
Where("(JSON_EXTRACT(status, '$.buildVersionCode') IS NULL OR JSON_EXTRACT(status, '$.buildVersionCode')<:version)").
Param("version", utils.VersionToLong(version)).