Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
  
    Let me first describe what I would like to have: I want to setup a number 
or servers (2, maybe 3, in my case). 
    These servers are setup in an HA-cluster with shared store. None of them is 
a dedicate master or backup server. Just the first started shall become live, 
the second shall run as backup (take over after the live was stopped or died), 
more additional servers waiting to become the next backup. No failback is 
needed since all servers have are considered equal.
    A use case would be to run the servers in an application container like 
kubernetes. It will be the containers jobs to start up the servers and 
automatically restart them when they stopped. 
    
    Right now, this is nearly possible: when a master server is started and 
there is already a live server, it will wait (as a backup server) until it can 
become life. The 'start()' method returns only after the startup is fully 
complete and the server became life. The unfortunate thing about this behaviour 
is that the start() methods (in EmbeddedJMS and ActiveMQServerImpl) are 
synchronized. Not returning from start will kept the server object locked such 
that stop() cannot be called.
    
    This was the reason why I thought this would be a defect that I had tried 
to fix. Apparently such a fix breaks backwards compatibility. So I would rather 
implement an enhancement to achieve this.
    (Unless you agreed that start() not returning is indeed a defect that 
should be fixed).
    
    So I can right now see a couple of alternatived to provide such a feature:
    1. Add an option to the master server configuration to allow the master to 
start as backup server if there is already a live server, like this:
    ```
    <ha-policy>
      <shared-store>
        <master>
          <allow-as-backup>true</allow-as-backup>
        </master>
      </shared-store>
    </ha-policy>
    ```
    1. Create a new shared-store policy type that indicates a new role (neither 
master nor server), e.g.:
    ```
    <ha-policy>
      <shared-store>
        <master-or-slave/>
      </shared-store>
    </ha-policy>
    ```
    1. Or even don't mention such a role name at all and make it the default 
behavior, like this:
    ```
    <ha-policy>
      <shared-store/>
    </ha-policy>
    ```
    
    What I would like to get as input:
    1. Shall I make such an enhancement? If yes:
    1. Which of the three alternatives should I implement - or do you rather 
propose another solution?
    1. For the first 2 alternatives: what should name of the option or policy 
type be? 
    1. When adding such an enhancement, so far I know that I need to enhance 
the XML schema, implement the option or policy class, implement the related 
behavior, add tests, and adapt documentation. Is there anything else I'm not 
aware of?


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to