Skip to content

Conversation

@gammazero
Copy link
Contributor

No description provided.

@gammazero gammazero requested a review from a team as a code owner July 10, 2025 02:27
@gammazero gammazero changed the title Clear provider queue provider: clear (re)provide queue Jul 10, 2025
@codecov
Copy link

codecov bot commented Jul 10, 2025

Codecov Report

Attention: Patch coverage is 50.74627% with 33 lines in your changes missing coverage. Please review.

Project coverage is 61.60%. Comparing base (9d087ca) to head (20e8e90).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
provider/internal/queue/queue.go 53.96% 19 Missing and 10 partials ⚠️
provider/noop.go 0.00% 2 Missing ⚠️
provider/reprovider.go 0.00% 2 Missing ⚠️

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #978      +/-   ##
==========================================
+ Coverage   61.54%   61.60%   +0.05%     
==========================================
  Files         254      254              
  Lines       31420    31487      +67     
==========================================
+ Hits        19339    19398      +59     
- Misses      10503    10507       +4     
- Partials     1578     1582       +4     
Files with missing lines Coverage Δ
provider/provider.go 60.55% <ø> (ø)
provider/noop.go 0.00% <0.00%> (ø)
provider/reprovider.go 61.68% <0.00%> (+1.80%) ⬆️
provider/internal/queue/queue.go 63.21% <53.96%> (-2.95%) ⬇️

... and 9 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

gammazero added a commit to ipfs/kubo that referenced this pull request Jul 10, 2025
When the currently configured reprovide strategy does not match the previous strategy read from the datastore, then clear the reprovide queue and update the reprovide strategy that is stored in the datastore.

Depends on ipfs/boxo#978

Closes #10829
Copy link
Contributor

@guillaumemichel guillaumemichel left a comment

Choose a reason for hiding this comment

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

Looks good and efficient. Flagged a few nits.

This only clears the provide queue though, not the reprovide queue.

There is no proper reprovider queue, the reprovider iterates on the cids returned by the KeyChanFunc. We can cancel the ongoing reprovide operation by cancelling this loop.

It makes sense to give users the opportunity to clear the provide queue, since it is persisted across reboots. Reprovide operations are cancelled on node restart, but if the reprovide strategy doesn't change, the set of cids to be reprovided stays the same, and cannot be cleared by this command. So after the node restarts and waits ReprovideInterval a new reprovide will be triggered.

@gammazero gammazero changed the title provider: clear (re)provide queue provider: clear provide queue Jul 10, 2025
@gammazero gammazero merged commit 6cfa794 into main Jul 10, 2025
17 checks passed
@gammazero gammazero deleted the clear-provider-queue branch July 10, 2025 08:54
gammazero added a commit to ipfs/kubo that referenced this pull request Jul 16, 2025
* provider: clear reprovide queue when reprovide strategy changes

When the currently configured reprovide strategy does not match the previous strategy read from the datastore, then clear the reprovide queue and update the reprovide strategy that is stored in the datastore.

Depends on ipfs/boxo#978

Closes #10829

* Update docs/changelogs/v0.36.md

Co-authored-by: Guillaume Michel <[email protected]>

* update log message
* update boxo
* Move change log to v0.37.md
* Add `provide clear` command to clear provide queue

The `provide clear` command clears all items from the provide queue and prints out the number of items removed from the queue. The `quiet` option tells the command not to print output.

* refactor(cmds): ipfs provide clear

moving to new namespace to avoid conflicts, and also document other
commands

* docs: clarify Reprovider.Strategy
* chore: remove undesired md link
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants