[GitHub] activemq-artemis pull request #1204: ARTEMIS-1112: don't block live activati...

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
30 messages Options
12
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis pull request #1204: ARTEMIS-1112: don't block live activati...

franz1981
GitHub user bgutjahr opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1204

    ARTEMIS-1112: don't block live activation if another live server is running

    Instead of going directly into backup mode within the shared-store
    live activation, we just change the HA-policy to slave and return
    to the caller - ActiveMQServerImpl.internalStart().
    The caller will then handle the backup activation as usual
    in a separate thread, such that EmbeddedJMS.start() can return.
    
    modified:   artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/bgutjahr/activemq-artemis master-as-backup

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1204.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1204
   
----
commit b3e39e3c2038de9c94251525a21f216d82cd0958
Author: Bernd Gutjahr <[hidden email]>
Date:   2017-04-13T13:01:36Z

    ARTEMIS-1112: don't block live activation if another live server is running
   
    Instead of going directly into backup mode within the shared-store
    live activation, we just change the HA-policy to slave and return
    to the caller - ActiveMQServerImpl.internalStart().
    The caller will then handle the backup activation as usual
    in a separate thread, such that EmbeddedJMS.start() can return.
    
    modified:   artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/SharedStoreLiveActivation.java

----


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    Can you add a test to your commit?


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    also, this kind of thing it first needs a master, then a cherrypick into 1.x
   
   
    or if you exceptionally fixed into 1.x for a good reason, then you need to push the change on master.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    OK, I'll push my change on master. The reason why I did it for 1.x is that we have a product which is currently using 1.5.4 and we did not yet plan to switch 2.0 so far. I have not even started to look into what implications a switch to 2.0 would have for us.
   
    I can try to write a test. Can someone give me some hints, e.g. where to put it, what other test I could use as a model?


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    For an example of how the test might look take a peek at org.apache.activemq.artemis.tests.integration.SimpleTest or org.apache.activemq.artemis.tests.integration.cluster.failover.SharedStoreBackupTest. You can put the resulting test in org.apache.activemq.artemis.tests.integration.cluster.failover.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    You may use smokeTests as well. we only have one now but we can expand.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    I have added an integration test. Jenkins build failed, but I don't see why.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis pull request #1204: ARTEMIS-1112: don't block live activati...

franz1981
In reply to this post by franz1981
Github user asfgit closed the pull request at:

    https://github.com/apache/activemq-artemis/pull/1204


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    Would it be possible to cherrypick this fix also into 1.x?


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    Sure, go for it.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    @jbertram can you check the testsuite. I think it got broken after this.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    @jbertram / @bgutjahr this added about 20 failures to the testsuite...
   
   
    Example: org.apache.activemq.artemis.tests.integration.cluster.failover.FailBackAutoTes
   
   
   
    I'm back from my PTO on monday.. let me know by then if this will be fixed or reverted :)


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    I'm going to have to revert this as it's breaking a handful of tests in the test-suite which rely on the semantic  which was changed.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    So what's your suggestion? Is it OK to change the semantics and should I adapt the failing test cases?
   
    Or is this rather a new feature? I could either add new option to SharedStoreMasterPolicyConfiguration and related config files (but I don't have a good name for that option), or a new SharedStorePolicyConfiguration class with the new semantics of: become master if no master is running, otherwise become backup. No failback, always failover on server shutdown (since all servers are treated equal, none of them is a dedicated master).
   
    Thinking about this, my personal favorite would be the new policy class and leaving the existing semantics unchanged. I could go for that, if you agree.
   
    What we actually want it this: run the artemis bus on two servers with a started store. Whichever is started first shall become master, the other backup. But we need to have the start method return in any case, to know that startup is completed.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user jbertram commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    Thinking about this more...I'm now not convinced that any changes to Artemis need to be made to support the functionality you're looking for. I believe you could start Artemis in a new thread if you like from your application, and you can use things like ActiveMQServer.registerActivationFailureListener or ActiveMQServer.isActive to stay informed about the status of the broker. Let me know what you think.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user bgutjahr commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    I had also thought about putting the start call into thread. But that would lead to a lifecyclt issue. Since EmbeddedServer start() and stop() methods are synchronized, I won't be able to stop a backup server before it became live.
   
    I have started looking a bit more into Artemis code. So far I have just added an option to the shared-store master configuration, prelimilarily named 'allow-as-backup'. This approach appeared a (little) bit easier than adding a new policy class.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    A new method preserving the old semantics ?


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    I will really need to revert this.
   
    You would need a new option for this new behaviour...
   
    When you have multiple Live server starting, the expected semantic is they waiting the previous live to shutdown before they can get live.
   
   
    As a backup, the backup will announce itself and failback would kick in.
   
   
    This is breaking failback for good, and now allowing the previous semantic in place. I have no other option beyond revert this.
   
   
    if you want this new behaviour, you will need an option, proper documentation and clear how this would behave. I have no idea how it would be consistent with everything else yet, but we could discuss.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
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 [hidden email] or file a JIRA ticket
with INFRA.
---
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[GitHub] activemq-artemis issue #1204: ARTEMIS-1112: don't block live activation if a...

franz1981
In reply to this post by franz1981
Github user clebertsuconic commented on the issue:

    https://github.com/apache/activemq-artemis/pull/1204
 
    I'm not against the enhancement.  If we implement a new making sense scheme to enable it I'm all for it.
   
   
    from the options you mentioned. a property on shared store would make sense.  I don't like the property and you choosed although I don't know a.m better one now.
   
   
    Something like allow-fallback=false with default to true keeping the current semantic would make sense to me.


---
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 [hidden email] or file a JIRA ticket
with INFRA.
---
12
Loading...