Memcache Extended Version 3.0.8
I. Retry_interval
$retry _interval The time of failover after an RPC server-side failure, the node is marked as unavailable, isolated, and quarantined for less than 0 retry_interval of time.
intMmc_server_valid (mmc_t *mmc tsrmls_dc)/*checks if a server should is considered valid to serve requests { {{*/{ if(MMC! =NULL) { if(Mmc->tcp.status >=mmc_status_disconnected) { return 1; } if(Mmc->tcp.status = = mmc_status_failed &&MMC->tcp.retry_interval >=0&& (Long) Time (NULL) >= mmc->tcp.failed + mmc->tcp.retry_interval) {
This is compared to the current time and fault occurrence time + isolation timereturn 1; } } return 0;}
Two. Retry Policy
Requesting a node to time out or fail will have a chance to retry, but when the server restarts, it does not seem to be a retry, just mark the connection status as unavailable. When the connection is used for the second time, the connection is rebuilt, so how many connections are made before the restart, and how many requests are unavailable.
/*read more data from Socket*/if(Php_stream_eof (mmc->readreq->io->stream)) {//server-side active disconnect, stream reads EOF result= Mmc_server_failure (MMC, Mmc->readreq->io,"Read failed (socket was unexpectedly closed)",0tsrmls_cc); if(Result = =mmc_request_failure) { /*Take server offline and failover requests*/mmc_server_deactivate (pool, MMC tsrmls_cc); } if (result = = Mmc_request_retry) {mmc_select_retry (pool, MMC, mmc-> readreq tsrmls_cc); }} Break;
The Scarlet Letter is after I add, originally the extension although marked the result is mmc_request_retry, but did not do the retry. A simple method can also be used in the extension to New Memcache (), Addserver once.