Question is about Redis server and sentinels configuration.
There are two subnetworks and I want to have 4 redis servers in total, 2 in each subnet. Since there might be connectivity issue I would like to configure sentinels in order to allow brain split for high availability.
So when connectivity issue happens there would appear two Redis setups which work independently for some time.
Now the question what will happen after connectivity of subnets is restored. Sentinels would detect brain split and two masters? Next they will elect only master and second one would be downgraded to a slave? Data from survived master would be pushed to a downgraded master and he would need to drop all data diff which was gained during connectivity issue?
Can I configure something in order for data to be merged?
There are 2 ways to handle HA in redis - sentinel and redis cluster.
Sentinel
Q: Since there might be connectivity issue I would like to configure sentinels in order to allow brain split for high availability
This is an anti-pattern of using sentinel. Here’s a similar example with even number of nodes explained in the docs
Q: Now the question what will happen after connectivity of subnets is restored. Sentinels would detect brain split and two masters?
Q: Data from survived master would be pushed to a downgraded master and he would need to drop all data diff which was gained during connectivity issue?
Yes
Q: Can I configure something in order for data to be merged? You can't, redis would never merge anything
Redis cluster
What is this beast for?
So it’s basically a multiple writer solution. But it doesn’t support merge operations either
Back to your scenario
Quoting from here
Note you can place sentinels on client machines too - this approach is heavily used in redis demos https://redis.io/topics/sentinel
You can also go with the cluster solution but it's harder to configure it + it has some limitations on multi-key operations and you'll still need to provide majority of nodes in case one of the subnets goes down to have some sort of HA