mongodb/mongo-php-driver — pull request #130 by cockatoo (2012-08-10 05:17:50+00:00)
Title: Crumbjp v1.2

I add the force ping flags to any ??ping functions to follow changing replica-set status more quickly.
It'll work as the following types of the list.

[ Normal time ]
- No change in this patch

[ Master down ]
1. It'll can be detected by mongo_util_link_failed(link.c) at the first requst but not important.
2. It'll be detected by mongo_util_link_get_socket (link.c) at every request.
3. It call mongo_util_rs_ping() with MONGO_INTERVAL_FOECE_LV1 is added by this patch.
4. And, it call mongo_util_rs_refresh() and mongo_util_server_ismaster() as for every 5 seconds.
It depends on MONGO_PING_INTERVAL value.

[ Master change ]
1. It'll be detected by mongo_util_link_failed(link.c) at the first requst as the "not master" error.
2. It call mongo_util_rs_ping() with MONGO_INTERVAL_FOECE_LV2 is added by this patch.
3. And, it certainly call mongo_util_rs_refresh() and mongo_util_server_ismaster() to reflesh replica-set status.
4. Then, it'll get the status of no master.
5. It'll do same as the [ Master down ]