Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vsm] 在对订单进行 release-deals 时,并未修改 state 字段。导致订单不能被释放出来 #602

Closed
1 of 4 tasks
cloudxin opened this issue Feb 14, 2023 · 4 comments · Fixed by #640
Closed
1 of 4 tasks
Assignees
Labels
bug Something isn't working P2 Medium - we should get to this soon vsmgr vsmgr related issue
Milestone

Comments

@cloudxin
Copy link
Contributor

cloudxin commented Feb 14, 2023

模块 / Components

  • venus-sector-manager
  • venus-worker
  • 工具链 / toolchains
  • 文档 / docs

版本 / Version

main分支版本

描述 / Describe the Bug

venus-makret 的订单释放由两个字段控制,分别是 storage_deals 表中的 state 和 piece_status。而使用 release-deals 时,只会把 piece_status 的状态改为 Undefine,对于 PreCommitSector 消息没有上链的订单,是可以正常释放出来。当 PreCommitSector 消息上链之后,state 字段就会由 29 变成 5,而 release-deals 功能并不会把对应的值也修改过来(命令无法释放出订单)。

venus-sector-manager util market release-deals --miner xxx --deal xxx

日志 / Logging Information

.

重现步骤 / Repo Steps

No response

@cloudxin cloudxin added the bug Something isn't working label Feb 14, 2023
@0x5459 0x5459 changed the title [vsm] 在对订单进行release-deals时,并未修改state字段。导致订单不能被释放出来 [vsm] 在对订单进行 release-deals 时,并未修改 state 字段。导致订单不能被释放出来 Feb 14, 2023
@diwufeiwen diwufeiwen added P2 Medium - we should get to this soon vsmgr vsmgr related issue labels Feb 14, 2023
@diwufeiwen
Copy link
Contributor

diwufeiwen commented Feb 14, 2023

venus:

UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus) error  
-> 
UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus market.PieceStatus, state storagemarket.StorageDealStatus) error

@diwufeiwen
Copy link
Contributor

diwufeiwen commented Feb 14, 2023

venus-cluster:

err = api.Market.UpdateDealStatus(gctx, maddr, abi.DealID(dealID), market.DealStatusUndefine, storagemarket.StorageDealAwaitingPreCommit)

@diwufeiwen
Copy link
Contributor

diwufeiwen commented Feb 14, 2023

venus-market:

func (ps *dealAssigner) UpdateDealStatus(ctx context.Context, miner address.Address, dealID abi.DealID, pieceStatus types.PieceStatus, state storagemarket.StorageDealStatus) error {
	md, err := ps.repo.StorageDealRepo().GetDealByDealID(ctx, miner, dealID)
	if err != nil {
		log.Error("get deal [%d] error for %s", dealID, miner)
		return fmt.Errorf("failed to get deal %d for miner %s: %w", dealID, miner.String(), err)
	}

	md.PieceStatus = pieceStatus
	md.State = state
	if err := ps.repo.StorageDealRepo().SaveDeal(ctx, md); err != nil {
		return fmt.Errorf("failed to update deal %d piece status for miner %s: %w", dealID, miner.String(), err)
	}

	return nil
}

@diwufeiwen
Copy link
Contributor

建议放在nv18版本中

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working P2 Medium - we should get to this soon vsmgr vsmgr related issue
Projects
Status: No status
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants