From c240edf54dd3913463dddab0e7f73655184f972a Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 16 Apr 2024 01:38:30 +0400 Subject: [PATCH 1/2] err check empty string --- storage/paths/db_index.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/storage/paths/db_index.go b/storage/paths/db_index.go index 470d5c33c6c..79239544533 100644 --- a/storage/paths/db_index.go +++ b/storage/paths/db_index.go @@ -723,7 +723,7 @@ func (dbi *DBIndex) StorageBestAlloc(ctx context.Context, allocate storiface.Sec FROM storage_path WHERE available >= $1 and NOW()-($2 * INTERVAL '1 second') < last_heartbeat - and heartbeat_err is null + and heartbeat_err = '' and (($3 and can_seal = TRUE) or ($4 and can_store = TRUE)) order by (available::numeric * weight) desc`, spaceReq, From dc271a361dcd54192866637e387507ed772f2d5b Mon Sep 17 00:00:00 2001 From: LexLuthr Date: Tue, 16 Apr 2024 01:50:11 +0400 Subject: [PATCH 2/2] log skipped tasks --- lib/harmony/harmonytask/harmonytask.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/harmony/harmonytask/harmonytask.go b/lib/harmony/harmonytask/harmonytask.go index dc71b299c2d..2d537868da9 100644 --- a/lib/harmony/harmonytask/harmonytask.go +++ b/lib/harmony/harmonytask/harmonytask.go @@ -313,7 +313,8 @@ func (e *TaskEngine) pollerTryAllWork() bool { resources.CleanupMachines(e.ctx, e.db) } for _, v := range e.handlers { - if v.AssertMachineHasCapacity() != nil { + if err := v.AssertMachineHasCapacity(); err != nil { + log.Debugf("skipped scheduling %s type tasks on due to %s", v.Name, err.Error()) continue } var unownedTasks []TaskID