-
Notifications
You must be signed in to change notification settings - Fork 245
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
Conversation
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.) |
7c04dd1
to
7be447c
Compare
Fixed the build. Please review it. Thanks. |
Daira, I fixed the build. Please review it. :-) Thanks a lot! On Fri, Feb 6, 2015 at 5:02 PM, Daira Hopwood notifications@github.com
|
7be447c
to
a3682b2
Compare
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.
a3682b2
to
677fbd7
Compare
Hi Daira, I have fixed all you suggested. Please review it. Thanks. |
Thank you very much for your contribution, Shu Lin! It is too bad that
Daira is so busy right now with other work. I hope she can review your
patch, too. I wonder if anyone else out there could review this patch?
|
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 |
There was a problem hiding this comment.
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
).
There was a problem hiding this comment.
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.
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. |
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