MM-40801: Use replica for getPostsAround (#19273)

This query deals with posts already created,
and it was originally already querying replica.

In recent performance investigations, this came up
a lot of times. I believe the change to query master
was unintentional.

```release-note
NONE
```
Этот коммит содержится в:
Agniva De Sarker
2022-01-04 22:37:19 +05:30
коммит произвёл GitHub
родитель 345e9cc841
Коммит 926e7c3b5e

Просмотреть файл

@@ -1404,7 +1404,7 @@ func (s *SqlPostStore) getPostsAround(before bool, options model.GetPostsOptions
if err != nil {
return nil, errors.Wrap(err, "post_tosql")
}
err = s.GetMasterX().Select(&posts, queryString, args...)
err = s.GetReplicaX().Select(&posts, queryString, args...)
if err != nil {
return nil, errors.Wrapf(err, "failed to find Posts with channelId=%s", options.ChannelId)
}
@@ -1439,7 +1439,7 @@ func (s *SqlPostStore) getPostsAround(before bool, options model.GetPostsOptions
if nErr != nil {
return nil, errors.Wrap(nErr, "post_tosql")
}
nErr = s.GetMasterX().Select(&parents, rootQueryString, rootArgs...)
nErr = s.GetReplicaX().Select(&parents, rootQueryString, rootArgs...)
if nErr != nil {
return nil, errors.Wrapf(nErr, "failed to find Posts with channelId=%s", options.ChannelId)
}