Skip to content

Check for fully removed pieces if not found in deletion scheduling queue#947

Open
ZenGround0 wants to merge 2 commits intopdpv0from
fix/piece-delete-log-spam
Open

Check for fully removed pieces if not found in deletion scheduling queue#947
ZenGround0 wants to merge 2 commits intopdpv0from
fix/piece-delete-log-spam

Conversation

@ZenGround0
Copy link
Collaborator

Addressing #924

I suspect that this will fix the problem but I could use your help seeing if this works @TippyFlitsUK

@ZenGround0 ZenGround0 requested a review from a team as a code owner February 5, 2026 20:42
@ZenGround0 ZenGround0 requested a review from rvagg February 5, 2026 20:42
@BigLep BigLep added the team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10 label Feb 5, 2026
@FilOzzy FilOzzy added this to FOC Feb 5, 2026
@github-project-automation github-project-automation bot moved this to 📌 Triage in FOC Feb 5, 2026
Copy link
Member

@rvagg rvagg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, except for that log needing some nuance

@github-project-automation github-project-automation bot moved this from 📌 Triage to ✔️ Approved by reviewer in FOC Feb 6, 2026
@rjan90
Copy link
Collaborator

rjan90 commented Feb 6, 2026

@rvagg With Zen OOO for the day(2026-02-06)/monday, any concerns with me committing the suggestion and merging this, so that we can cut a Curio tag?

@rvagg
Copy link
Member

rvagg commented Feb 6, 2026

@rjan90 make the changes here and ping me on slack and I'll come and re-review

@TippyFlitsUK
Copy link
Contributor

I am still seeing the errors in my logs after updating to this branch.

Note that these piece 80 alerts were also present prior to the update. They are not new.

{"level":"warn","ts":"2026-02-06T16:28:30.299Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-06T16:29:00.284Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-06T16:29:30.280Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-06T16:29:31.890Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}

@rvagg
Copy link
Member

rvagg commented Feb 9, 2026

@TippyFlitsUK would you mind grabbing the latest from this branch and giving it a go to see if you get those errors again, or anything like it? I believe this is good to go but would like to see confirmation.

@TippyFlitsUK
Copy link
Contributor

Still seeing these warning messages, I'm afraid:

curio version 1.27.0+calibnet+git_56ce8781_2026-02-09T22:38:27+13:00

{"level":"warn","ts":"2026-02-09T16:54:00.327Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:54:02.015Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:54:30.318Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:54:31.921Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:55:00.346Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:55:30.334Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}
{"level":"warn","ts":"2026-02-09T16:56:00.384Z","logger":"pdp","caller":"pdp/watch_piece_delete.go:39","msg":"Failed to process pending piece delete: piece 80 is not scheduled for removal"}

return xerrors.Errorf("failed to check if piece is live: %w", err)
}
if live {
return xerrors.Errorf("piece %d is not scheduled for removal", piece.PieceID)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
return xerrors.Errorf("piece %d is not scheduled for removal", piece.PieceID)
log.Warnw("piece is live but not in scheduled removals despite successful delete tx; (possible chain reorg) clearing stale delete tracking",
"dataSetId", piece.DataSetID, "pieceID", piece.PieceID, "txHash", piece.TxHash)
_, err := db.Exec(ctx, `UPDATE pdp_data_set_pieces SET rm_message_hash = NULL
WHERE data_set = $1 AND piece_id = $2 AND rm_message_hash = $3`,
piece.DataSetID, piece.PieceID, piece.TxHash)
if err != nil {
return xerrors.Errorf("failed to clear stale rm_message_hash: %w", err)
}
continue

I believe we might be seeing this for only a single piece, so I'm going to go out on a limb and say this instance was due to a chain reorg. We got a successful delete tx but now the chain says it's not a delete.

@ZenGround0 plausible?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oooh yeah that's a nice idea. Curio is executing these fast and reorging a block or two is pretty normal.

I'll file an issue to review curio for these more generally. In the past we were handing these pretty well but I suspect we haven't been as rigorous as we need to be.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

team/fs-wg Items being worked on or tracked by the "FS Working Group". See FilOzone/github-mgmt #10

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pdpv0: pdp_data_set_pieces.removed not updated after successful deletion transaction

6 participants