Skip to content

feat: Provider.WorkerCount and stats reprovide cmd #10779

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

Merged
merged 16 commits into from
Apr 30, 2025
Merged

Conversation

guillaumemichel
Copy link
Contributor

@guillaumemichel guillaumemichel commented Apr 9, 2025

This PR finalizes separation of provide and reprovide queues and exposes new configuration for adjusting performance of first-time provide.

@guillaumemichel guillaumemichel changed the title chore: adjust provide stats config: ProvideWorkerCount option Apr 16, 2025
@guillaumemichel guillaumemichel changed the title config: ProvideWorkerCount option feat(config): ProvideWorkerCount option Apr 16, 2025
@guillaumemichel
Copy link
Contributor Author

Currently two failing tests:

--- FAIL: TestIPFSVersionDeps (0.11s)
    basic_commands_test.go:73: 
        	Error Trace:	github.com/ipfs/kubo/test/cli/basic_commands_test.go:73
        	Error:      	Received unexpected error:
        	           	malformed module path "../boxo": invalid path element ".."
        	Test:       	TestIPFSVersionDeps
        	Messages:   	path: ../boxo, version: (devel)
2025-04-16T13:11:19.477+0200	PANIC	testharness	harness/run.go:128	'[/home/guissou/Documents/ipfs/kubo/cmd/ipfs/ipfs add -q --max-file-links 1024]' returned error, code: 1, err: exit status 1
stdout:
stderr:Error: unknown option "max-file-links"


--- FAIL: TestAdd (4.24s)
    --- FAIL: TestAdd/produced_unixfs_max_file_links:_command_flag_--max-file-links_overrides_configuration_in_Import.UnixFSFileMaxLinks (0.52s)
panic: '[/home/guissou/Documents/ipfs/kubo/cmd/ipfs/ipfs add -q --max-file-links 1024]' returned error, code: 1, err: exit status 1
	stdout:
	stderr:Error: unknown option "max-file-links"
	
	[recovered]
	panic: '[/home/guissou/Documents/ipfs/kubo/cmd/ipfs/ipfs add -q --max-file-links 1024]' returned error, code: 1, err: exit status 1
	stdout:
	stderr:Error: unknown option "max-file-links"

@guillaumemichel guillaumemichel linked an issue Apr 24, 2025 that may be closed by this pull request
3 tasks
@guillaumemichel guillaumemichel marked this pull request as ready for review April 24, 2025 13:39
@guillaumemichel guillaumemichel requested a review from a team as a code owner April 24, 2025 13:39
@lidel lidel mentioned this pull request Apr 24, 2025
45 tasks
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

Thank you @guillaumemichel, quick pass from UX perspective with some asks inline

Copy link
Member

Choose a reason for hiding this comment

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

nit: renaming field names here is a breaking change to existing command.

It will break compatibility with older RPC clients, libraries, and will also break user's scripts and automations.

Mind adding a note about this to the Changelog?

Since we have two queues, and they behave differently, I wonder if we should have ipfs stat provide and ipfs stat reprovide? (e.g. if we make breaking change anyway, any reason to not rename current provide to reprovide?)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I marked ipfs stats provide as deprecated, and renamed it to ipfs stats reprovide.

ipfs stats provide shows the same stats as ipfs stats reprovide but with the old names (only information related to reprovides, because we don't track provides anymore), so it shouldn't break existing scripts.

lidel added 3 commits April 30, 2025 14:33
we dont do that for Reprovider.Strategy which is more important,
this should reduce user confusion
explicitly document it is not used - without this legacy users will have
it in their config and be very confused
@lidel lidel force-pushed the adjust-stats-provide branch from db5ffe9 to 06e6618 Compare April 30, 2025 13:06
Copy link
Member

@lidel lidel left a comment

Choose a reason for hiding this comment

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

configuration lgtm, thank you!

(pushed small cosmetic tweaks to reduce confusion related to Provider.Strategy vs Reprovider.Strategy)

@lidel lidel changed the title feat(config): ProvideWorkerCount option feat(config): Provider.WorkerCount and stats reprovider cmd Apr 30, 2025
Comment on lines +52 to +53
fmt.Fprintf(wtr, "TotalProvides:\t%s\n", humanNumber(s.TotalReprovides))
fmt.Fprintf(wtr, "AvgProvideDuration:\t%s\n", humanDuration(s.AvgReprovideDuration))
Copy link
Contributor

Choose a reason for hiding this comment

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

Are the printed names correct? Seems like they should match the variable names, even if that causes a breaking change.

Copy link
Member

@lidel lidel Apr 30, 2025

Choose a reason for hiding this comment

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

Well, we would be making a breaking change – see #10779 (comment)

Safer to keep stats provide as-is now and mark it as deprecated + add new stats reprovide which has new labels.

We will remove / change stats provide in future release.


### `Provider.Strategy`

Legacy, not used at the moment, see [`Reprovider.Strategy`](#reproviderstrategy) instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
Legacy, not used at the moment, see [`Reprovider.Strategy`](#reproviderstrategy) instead.
Legacy, no longer used, see [`Reprovider.Strategy`](#reproviderstrategy) instead.

Otherwise, it sounds like we are trying to communicate a planned future use.

Copy link
Member

Choose a reason for hiding this comment

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

We might? Now that we have separate queues, we may have strategies related to provide that are different than reprovide

Left as-is for now.

@lidel lidel changed the title feat(config): Provider.WorkerCount and stats reprovider cmd feat(config): Provider.WorkerCount and stats reprovide cmd Apr 30, 2025
@lidel lidel merged commit a599737 into master Apr 30, 2025
18 checks passed
@lidel lidel deleted the adjust-stats-provide branch April 30, 2025 13:32
@lidel lidel changed the title feat(config): Provider.WorkerCount and stats reprovide cmd feat: Provider.WorkerCount and stats reprovide cmd Apr 30, 2025
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.

Provider performance regression
3 participants