diff options
author | Simon Rettberg | 2019-08-22 16:14:27 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-08-22 16:14:27 +0200 |
commit | 5fb4ef278be86fb6bda487f65ec4855d830bf4e5 (patch) | |
tree | f06c1ce5466b14bb4ff47dbd2939e11b8eedf6d0 /src/server/altservers.h | |
parent | [SERVER] Put request handle into CMD_ERROR reply (diff) | |
download | dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.tar.gz dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.tar.xz dnbd3-5fb4ef278be86fb6bda487f65ec4855d830bf4e5.zip |
[SERVER] Get rid of alt-servers thread, per-uplink rtt history
Alt-Server checks are now run using the threadpool, so we don't need a
queue and dedicated thread anymore. The rtt history is now kept per
uplink, so many uplinks won't overwhelm the history, making its time
window very short.
Also the fail counter is now split up; a global one for when the server
actually isn't reachable, a local (per-uplink) one for when the server
is reachable but doesn't serve the requested image.
Diffstat (limited to 'src/server/altservers.h')
-rw-r--r-- | src/server/altservers.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/server/altservers.h b/src/server/altservers.h index e03b900..8e2b964 100644 --- a/src/server/altservers.h +++ b/src/server/altservers.h @@ -7,23 +7,27 @@ struct json_t; void altservers_init(); -void altservers_shutdown(); - int altservers_load(); bool altservers_add(dnbd3_host_t *host, const char *comment, const int isPrivate, const int isClientOnly); -void altservers_findUplink(dnbd3_uplink_t *uplink); +void altservers_findUplinkAsync(dnbd3_uplink_t *uplink); -void altservers_removeUplink(dnbd3_uplink_t *uplink); +void altservers_findUplink(dnbd3_uplink_t *uplink); int altservers_getListForClient(dnbd3_host_t *host, dnbd3_server_entry_t *output, int size); -int altservers_getListForUplink(dnbd3_host_t *output, int size, int emergency); +int altservers_getHostListForReplication(dnbd3_host_t *servers, int size); + +bool altservers_toString(int server, char *buffer, size_t len); int altservers_netCloseness(dnbd3_host_t *host1, dnbd3_host_t *host2); -void altservers_serverFailed(const dnbd3_host_t * const host); +void altservers_serverFailed(int server); + +int altservers_hostToIndex(dnbd3_host_t *host); + +const dnbd3_host_t* altservers_indexToHost(int server); struct json_t* altservers_toJson(); |