'Redis HA what happens if Master stops and restarted

In a Redis HA setup, with 1 master and 5 replicas: Let's suppose the master goes down. Then the Sentinels would elect a replica as the next master.

What happens when the original master is restarted with its config? Would it be joining as a master or as a replica? I suppose, since it is not configured as a replica, so it should not be running as a replica.



Solution 1:[1]

When the original master is down and a new master is elected. The original master will be added as a virtual replica of the new master. When it recovers, original master will be set to be a replica of the new master automatically.

Solution 2:[2]

Master would join as a replica.

...The master will then demote itself to a replica... https://redis.io/commands/failover

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 for_stack
Solution 2