Skip to content
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

Ticket #573: A server selection framework. #140

Closed
wants to merge 1 commit into from

Conversation

linshu
Copy link

@linshu linshu commented Feb 5, 2015

The 3rd party server selection function can be passed in as
[client][server_selection_hook] in the tahoe.cfg file.
The format is python module syntax, like "module_a.submodule_b.function_c".
A default hook function "sort_servers" is implemented in allmydata.storage_client
to catch no 3rd party hook functoin configured case.


This change is Reviewable

@daira
Copy link
Member

daira commented Feb 7, 2015

Please fix the test failures on this branch, then we'll review it. (If you need any help, don't hesitate to ask on Freenode #tahoe-lafs or the tahoe-dev list.)

@linshu linshu force-pushed the 573-server-selection branch 3 times, most recently from 7c04dd1 to 7be447c Compare February 7, 2015 03:55
@linshu
Copy link
Author

linshu commented Feb 7, 2015

Fixed the build. Please review it. Thanks.

@linshu
Copy link
Author

linshu commented Feb 7, 2015

Daira,

I fixed the build. Please review it. :-)

Thanks a lot!
-Shu

On Fri, Feb 6, 2015 at 5:02 PM, Daira Hopwood notifications@github.com
wrote:

Please fix the test failures on this branch, then we'll review it. (If you
need any help, don't hesitate to ask on Freenode #tahoe-lafs or the
tahoe-dev list.)


Reply to this email directly or view it on GitHub
#140 (comment).

@daira daira self-assigned this Feb 9, 2015
The 3rd party server selection function can be passed in as
[client][server_selection_hook] in the tahoe.cfg file.
The format is python module syntax, like "module_a.submodule_b.function_c".
A default hook function "sort_servers" is implemented in allmydata.storage_client
to catch no 3rd party hook functoin configured case.
@linshu
Copy link
Author

linshu commented May 8, 2015

Hi Daira,

I have fixed all you suggested. Please review it.

Thanks.

@zooko
Copy link
Member

zooko commented May 8, 2015 via email

@daira
Copy link
Member

daira commented May 16, 2015

v1.10.1 is feature-frozen, but I will definitely review it for v1.11 after the v1.10.1 release.

:param key: Specifies a function of one argument that is used to extract a comparison key from Tahoe server list
element. The 3rd party can use this as a default comparison key if they don't want to provide their own
comparison algorithm but still want to keep using the server selection framework.
:return: A sorted server list
Copy link
Contributor

Choose a reason for hiding this comment

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

This seems like a complicated API to export to users -- what they're supposed to do with key seems unclear (e.g. what if it's not specified? can it be ignored if it is specified?). I think it would be better if the "sort_servers" function takes only a single argument (the servers list). Or, maybe the second argument should be peer_selection_index?

Then for this default implementation, you could move the permuted inner-method from get_servers_for_psi into this function and thus still call sorted in the same fashion (with key=permuted).

Copy link
Member

Choose a reason for hiding this comment

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

We discussed this in a Tahoe Nuts and Bolts meeting, and decided that this should be passed the peer_selection_index. If we don't pass that, then the hook does not have enough information to make changes to how the _permuted algorithm below works.

@exarkun
Copy link
Member

exarkun commented Jan 22, 2020

Thanks to everyone for their efforts so far. This looks like a good start. The review feedback hasn't been addressed yet and the feature overall needs test coverage and probably additional documentation.

Please feel free to re-open this PR if there's still interest in contributing here.

@exarkun exarkun closed this Jan 22, 2020
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.

5 participants