In cluster mode, which SQ node with a Web process will be in charge of updating the database and elasticsearch is decided by configuration in sonar.properties (property sonar.cluster.web.startupLeader).
This should be replaced by relying a cluster-wide shared flag/information indicated who's the startup leader.
This decision will be taken in the main process of SQ.
The startup leader must be a Node with a Web server enabled.
ES-only nodes can start right away without waiting for the cluster leader.
Cluster leader must wait for ElasticSearch cluster to be yellow before starting.
Nodes with at least one of Web or CE process must wait for the cluster leader to be fully started.
Non-cluster-leader WEB/CE nodes will wait for cluster leader startup, without any timeout.