Skip to content

Commit

Permalink
test: sp exit
Browse files Browse the repository at this point in the history
  • Loading branch information
constwz committed Jun 12, 2024
1 parent 451ef72 commit fdd555e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/docker-develop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: Docker-CI

on:
push:
branches: [ develop, master]
branches: [ develop, master, test-sp-exit]

env:
IMAGE_NAME: ghcr.io/bnb-chain/greenfield-storage-provider-invisible
Expand Down
3 changes: 3 additions & 0 deletions modular/executor/execute_task.go
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,7 @@ func (e *ExecuteModular) recoverByPrimarySP(ctx context.Context, task coretask.R
return err
}
if task.BySuccessorSP() {
log.CtxInfow(ctx, "DebugInfo setPieceMetadata", "object_id", objectId, "segment_index", segmentIdx)
err = e.setPieceMetadata(ctx, task, pieceData)
if err != nil {
log.CtxErrorw(ctx, "failed to set piece meta data to DB", "object_name:", task.GetObjectInfo().GetObjectName(), "segment_idx", task.GetSegmentIdx(), "redundancy_idx", task.GetEcIdx(), "error", err)
Expand Down Expand Up @@ -701,6 +702,7 @@ func (e *ExecuteModular) setPieceMetadata(ctx context.Context, task coretask.Rec
"segment_index", segmentIdx, "error", err)
return err
}
log.CtxInfow(ctx, "DebugInfo", "pieceChecksums", pieceChecksums, "segmentCount", segmentCount)
if len(pieceChecksums) == int(segmentCount) {
integrityChecksum := hash.GenerateIntegrityHash(pieceChecksums)
integrityMeta := &spdb.IntegrityMeta{
Expand All @@ -709,6 +711,7 @@ func (e *ExecuteModular) setPieceMetadata(ctx context.Context, task coretask.Rec
IntegrityChecksum: integrityChecksum,
PieceChecksumList: pieceChecksums,
}
log.CtxInfow(ctx, "SetObjectIntegrity", "object_id", objectID, "segment_index", segmentIdx)
if err = e.baseApp.GfSpDB().SetObjectIntegrity(integrityMeta); err != nil {
log.CtxErrorw(ctx, "failed to set object integrity", "object_id", objectID,
"segment_index", segmentIdx, "error", err)
Expand Down

0 comments on commit fdd555e

Please sign in to comment.