Skip to content

Provide consistent view of primary and secondaries

Sami Hiltunen requested to merge smh-shard-status into master

There is a possible race condition when getting primaries and secondaries. Currently, the primary is cached in memory when getting the primary. The cached primary is then used to determine which nodes are the secondaries. If the primary fails before the call to GetSecondaries is made, we'll get inconsistent secondaries as the previous primary that failed over would now be considered a secondary along with the newly elected primary. This commit fixes the problem by returning a complete status of the shard each time and thus avoiding inconsistencies.

Closes #2641 (closed)

I'm doing the refactoring for #2630 (closed) as I'll add the read only status to the Shard struct.

Merge request reports

Loading