fix bigint overflow bug

This commit is contained in:
Shrenuj Bansal 2023-08-09 15:27:12 -04:00
parent 87cb6f67f1
commit 84d9dc5dfe

View File

@ -1282,8 +1282,6 @@ func (i *Index) StorageInfo(ctx context.Context, id storiface.ID) (storiface.Sto
i.lk.RLock() i.lk.RLock()
defer i.lk.RUnlock() defer i.lk.RUnlock()
log.Errorf("StorageInfo called id: ", id)
si, found := i.stores[id] si, found := i.stores[id]
if !found { if !found {
return storiface.StorageInfo{}, xerrors.Errorf("sector store not found") return storiface.StorageInfo{}, xerrors.Errorf("sector store not found")
@ -1341,7 +1339,7 @@ func (dbi *DBIndex) StorageBestAlloc(ctx context.Context, allocate storiface.Sec
where %s and available >= $1 where %s and available >= $1
and NOW()-last_heartbeat < $2 and NOW()-last_heartbeat < $2
and heartbeat_err is null and heartbeat_err is null
order by available * weight desc`, checkString) order by (available::numeric * weight) desc`, checkString)
err = dbi.harmonyDB.Select(ctx, &rows, err = dbi.harmonyDB.Select(ctx, &rows,
sql, spaceReq, SkippedHeartbeatThresh) sql, spaceReq, SkippedHeartbeatThresh)
if err != nil { if err != nil {