From 4c8bfa5c66a1028ae6a417bf4a269b24241cbb09 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=81ukasz=20Magiera?= Date: Sat, 20 Apr 2024 09:39:38 +0200 Subject: [PATCH] fix: curio: Update pgx imports, fix db_storage alloc --- curiosrc/market/lmrpc/lmrpc.go | 2 +- lib/harmony/harmonytask/singleton_task.go | 2 +- storage/paths/db_index.go | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/curiosrc/market/lmrpc/lmrpc.go b/curiosrc/market/lmrpc/lmrpc.go index dd78802894a..33c0d34deb3 100644 --- a/curiosrc/market/lmrpc/lmrpc.go +++ b/curiosrc/market/lmrpc/lmrpc.go @@ -14,8 +14,8 @@ import ( "github.com/google/uuid" logging "github.com/ipfs/go-log/v2" - "github.com/jackc/pgx/v5" manet "github.com/multiformats/go-multiaddr/net" + "github.com/yugabyte/pgx/v5" "golang.org/x/xerrors" "github.com/filecoin-project/go-address" diff --git a/lib/harmony/harmonytask/singleton_task.go b/lib/harmony/harmonytask/singleton_task.go index 72003341026..2395f343c38 100644 --- a/lib/harmony/harmonytask/singleton_task.go +++ b/lib/harmony/harmonytask/singleton_task.go @@ -4,7 +4,7 @@ import ( "errors" "time" - "github.com/jackc/pgx/v5" + "github.com/yugabyte/pgx/v5" "github.com/filecoin-project/lotus/lib/harmony/harmonydb" "github.com/filecoin-project/lotus/lib/passcall" diff --git a/storage/paths/db_index.go b/storage/paths/db_index.go index 79239544533..499c425bec3 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 = '' + and heartbeat_err IS NULL and (($3 and can_seal = TRUE) or ($4 and can_store = TRUE)) order by (available::numeric * weight) desc`, spaceReq,