From 06a2f8c670938a558ff92c24fe7840153b5c3102 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 17 Feb 2024 00:57:27 +0100 Subject: [PATCH] paths: Fix dbindex heartbeat --- storage/paths/db_index.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/storage/paths/db_index.go b/storage/paths/db_index.go index 1472997b6..9d12eb70f 100644 --- a/storage/paths/db_index.go +++ b/storage/paths/db_index.go @@ -324,12 +324,13 @@ func (dbi *DBIndex) StorageReportHealth(ctx context.Context, id storiface.ID, re retryWait := time.Millisecond * 20 retryReportHealth: _, err := dbi.harmonyDB.Exec(ctx, - "UPDATE storage_path set capacity=$1, available=$2, fs_available=$3, reserved=$4, used=$5, last_heartbeat=NOW()", + "UPDATE storage_path set capacity=$1, available=$2, fs_available=$3, reserved=$4, used=$5, last_heartbeat=NOW() where storage_id=$6", report.Stat.Capacity, report.Stat.Available, report.Stat.FSAvailable, report.Stat.Reserved, - report.Stat.Used) + report.Stat.Used, + id) if err != nil { //return xerrors.Errorf("updating storage health in DB fails with err: %v", err) if harmonydb.IsErrSerialization(err) {