globalsign / mgo

The MongoDB driver for Go
Other
1.97k stars 230 forks source link

Add support to MaxStalenessSeconds in ReadPreference #271

Open wpjunior opened 6 years ago

wpjunior commented 6 years ago

from #270

wpjunior commented 5 years ago

Hi @eminano, would you check the possibility to approve this MR ?, this scenario is too hard to create an integration test.

Thanks =)

wangke1020 commented 5 years ago

It seems the changes only pass a ReadPreference params to server and did not select proper servers, so at my guess the driver will not work with mongo replset but sharding cluster. According to https://github.com/mongodb/specifications/blob/master/source/max-staleness/max-staleness.rst#client, server selection should be implemented in client side.