Skip to content

Commit

Permalink
fix: Batching Hotfixes (#351)
Browse files Browse the repository at this point in the history
  • Loading branch information
magik6k authored Jan 6, 2025
1 parent d0e5f5e commit a5972b0
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
3 changes: 3 additions & 0 deletions harmony/harmonydb/sql/20241210-sdr-batching.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
ALTER TABLE sectors_sdr_pipeline ADD COLUMN precommit_ready_at TIMESTAMPTZ;
ALTER TABLE sectors_sdr_pipeline ADD COLUMN commit_ready_at TIMESTAMPTZ;

UPDATE sectors_sdr_pipeline SET precommit_ready_at = CURRENT_TIMESTAMP AT TIME ZONE 'UTC' WHERE after_tree_r = TRUE;
UPDATE sectors_sdr_pipeline SET commit_ready_at = CURRENT_TIMESTAMP AT TIME ZONE 'UTC' WHERE after_porep = TRUE;

-- Function to precommit_ready_at value. Used by the trigger
CREATE OR REPLACE FUNCTION set_precommit_ready_at()
RETURNS TRIGGER AS $$
Expand Down
8 changes: 5 additions & 3 deletions tasks/seal/poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"time"

logging "github.com/ipfs/go-log/v2"
"github.com/samber/lo"
"golang.org/x/xerrors"

"github.com/filecoin-project/go-address"
Expand Down Expand Up @@ -238,11 +239,12 @@ func (s *SealPoller) poll(ctx context.Context) error {
return err
}

tasks = lo.Filter(tasks, func(t pollTask, _ int) bool {
return !t.Failed
})

for _, task := range tasks {
task := task
if task.Failed {
continue
}

ts, err := s.api.ChainHead(ctx)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion tasks/snap/task_submit.go
Original file line number Diff line number Diff line change
Expand Up @@ -502,7 +502,7 @@ func (s *SubmitTask) CanAccept(ids []harmonytask.TaskID, engine *harmonytask.Tas

func (s *SubmitTask) TypeDetails() harmonytask.TaskTypeDetails {
return harmonytask.TaskTypeDetails{
Name: "BatchUpdateSubmit",
Name: "UpdateBatch",
Cost: resources.Resources{
Cpu: 1,
Ram: 64 << 20,
Expand Down

0 comments on commit a5972b0

Please sign in to comment.