stratos-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Reka Thirunavukkarasu <r...@wso2.com>
Subject Re: Testing 4.1: startupOrder not working in certain scenarios ? was ... RE: [Discuss] Fixing Comma Separated Dependency JSON Definitions
Date Thu, 14 May 2015 09:37:56 GMT
HI Martin,

Please note that the following startup order will also provide the same
behavior. Actually the second startup order can be either independent from
the first startup order or the second one needs to specify where to plug
the list to the existing startup order. No need give the complete path.

"startupOrders": [
      {
        "aliases": [
          "cartridge.c3-0x0",
          "cartridge.c2-0x0",
          "cartridge.c1-0x0"
        ]
      },

      {
        "aliases": [
          "cartridge.c2-0x0",
          "cartridge.c4-0x0",
          "cartridge.c5-0x0"
        ]
      }
    ]

Thanks,
Reka


On Thu, May 14, 2015 at 2:58 PM, Reka Thirunavukkarasu <reka@wso2.com>
wrote:

> Hi Martin,
>
> This issue has been fixed in 7deb1127caadb088fd3900c7825975051771bc82. I
> have verified the samples and it is working fine now..Can you also verify
> it?
>
> Thanks,
> Reka
>
> On Thu, May 14, 2015 at 11:43 AM, Reka Thirunavukkarasu <reka@wso2.com>
> wrote:
>
>> HI Martin,
>>
>> These are good samples to test the startup order with different
>> scenarios..We already supported this type of startup Orders. I have tried
>> this samples and found out that there was a bug in the logic. I'm fixing it
>> and update the thread..
>>
>>
>> Thanks,
>> Reka
>>
>> On Thu, May 14, 2015 at 12:14 AM, Martin Eppel (meppel) <meppel@cisco.com
>> > wrote:
>>
>>>  Hi Imesh,
>>>
>>>
>>>
>>> Assuming my assumptions in terms of proper startupOrder definitions
>>> (based on the examples below and from the samples) are correct I generated
>>> a few test scenarios with various startupOrders:
>>>
>>>
>>>
>>> [0.] Scenario 0.
>>>
>>> c3 – c2 – c1 (first c3, when c3 active then c2, when c2 active then c1)
>>>
>>>
>>>
>>> What I observed is that c3, c2, and c1 came up in the proper sequence, works
>>> as expected !
>>>
>>>
>>>
>>> [1.] Scenario 1.
>>>
>>>
>>>
>>> c3 – c2 –  c1 (first c3, when c3 active then c2, when c2 active then c1)
>>>
>>> and in parallel:
>>>
>>> c5 – c4 (first c5, when c5 active then c4)
>>>
>>>
>>>
>>> The startupOrder json for [1.] (as I assumed based on the examples in
>>> the email thread) is listed in [1b].
>>>
>>>
>>>
>>> What I observed is that c3, c2, and c1 came up in the proper sequence,
>>> but c5 and c4 were started in parallel (instead of the expected sequence of
>>> c5 -> c4)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> [2.] Scenario 2:
>>>
>>> c3 – c2 –c1 (first c3, when c3 active then c2, when c2 active then c1)
>>>
>>>
>>>
>>> and when c2 becomes active a parallel startupOrder should be active:
>>>
>>>
>>>
>>> c3 – c2 –c5 –  c4 (when c2 is active then c5, when c5 is active then c4)
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> The startupOrder json for [2.] (as I assumed based on the examples in
>>> the email thread) is listed in [2b]
>>>
>>>
>>>
>>> What I observed is that none of the VMs qere started up.
>>>
>>>
>>>
>>> Please let me know if the json is correct or which else format is
>>> expected for scenarios as described above or there are issues with the
>>> described scenarios
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Martin
>>>
>>>
>>>
>>> JSONs :
>>>
>>>
>>>
>>> [0b] startupOrder json for scenario 0.:
>>>
>>>
>>>
>>> {
>>>
>>>   "name": "s-g-c1-c2-c3-s",
>>>
>>>   "dependencies": {
>>>
>>>     "terminationBehaviour": "terminate-none",
>>>
>>>     "startupOrders": [
>>>
>>>       {
>>>
>>>         "aliases": [
>>>
>>>           "cartridge.c3-0x0",
>>>
>>>           "cartridge.c2-0x0",
>>>
>>>           "cartridge.c1-0x0"
>>>
>>>         ]
>>>
>>>       }
>>>
>>>     ]
>>>
>>>   },
>>>
>>>   "cartridges": [
>>>
>>>     "c1",
>>>
>>>     "c2",
>>>
>>>     "c3"
>>>
>>>   ],
>>>
>>>   "groups": []
>>>
>>> }
>>>
>>>
>>>
>>> [1b] startupOrder json for scenario 1.:
>>>
>>>
>>>
>>> {
>>>
>>>   "name": "s-g-c1-c2-c3-s-1",
>>>
>>>   "dependencies": {
>>>
>>>     "terminationBehaviour": "terminate-none",
>>>
>>>     "startupOrders": [
>>>
>>>       {
>>>
>>>         "aliases": [
>>>
>>>           "cartridge.c3-0x0",
>>>
>>>           "cartridge.c2-0x0",
>>>
>>>           "cartridge.c1-0x0"
>>>
>>>         ]
>>>
>>>       },
>>>
>>>       {
>>>
>>>         "aliases": [
>>>
>>>           "cartridge.c5-0x0",
>>>
>>>           "cartridge.c4-0x0"
>>>
>>>         ]
>>>
>>>       }
>>>
>>>     ]
>>>
>>>   },
>>>
>>>   "cartridges": [
>>>
>>>     "c1",
>>>
>>>     "c2",
>>>
>>>     "c3",
>>>
>>>     "c4",
>>>
>>>     "c5"
>>>
>>>   ],
>>>
>>>   "groups": []
>>>
>>> }
>>>
>>>
>>>
>>> [2b] startupOrder json for scenario 2.:
>>>
>>>
>>>
>>> {
>>>
>>>   "name": "s-g-c1-c2-c3-s-2",
>>>
>>>   "dependencies": {
>>>
>>>     "terminationBehaviour": "terminate-none",
>>>
>>>     "startupOrders": [
>>>
>>>       {
>>>
>>>         "aliases": [
>>>
>>>           "cartridge.c3-0x0",
>>>
>>>           "cartridge.c2-0x0",
>>>
>>>           "cartridge.c1-0x0"
>>>
>>>         ]
>>>
>>>       },
>>>
>>>       {
>>>
>>>         "aliases": [
>>>
>>>           "cartridge.c3-0x0",
>>>
>>>           "cartridge.c2-0x0",
>>>
>>>           "cartridge.c4-0x0",
>>>
>>>           "cartridge.c5-0x0"
>>>
>>>         ]
>>>
>>>       }
>>>
>>>     ]
>>>
>>>   },
>>>
>>>   "cartridges": [
>>>
>>>     "c1",
>>>
>>>     "c2",
>>>
>>>     "c3",
>>>
>>>     "c4",
>>>
>>>     "c5"
>>>
>>>   ],
>>>
>>>   "groups": []
>>>
>>> }
>>>
>>>
>>>
>>>
>>>
>>> *From:* Martin Eppel (meppel)
>>> *Sent:* Tuesday, May 12, 2015 9:13 PM
>>> *To:* dev@stratos.apache.org; Shaheedur Haque (shahhaqu)
>>> *Cc:* Reka Thirunavukkarasu; Dakshika Jayathilaka
>>> *Subject:* RE: [Discuss] Fixing Comma Separated Dependency JSON
>>> Definitions
>>>
>>>
>>>
>>> Hey Imesh,
>>>
>>>
>>>
>>> If I have the following startupOrder in a group:
>>>
>>>
>>>
>>> When A is active B and K starts up, when B is active, C and D start up,
>>> when D is active E starts up – what should the json look like:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>              C
>>>
>>>           /
>>>
>>>        B
>>>
>>>     /   \
>>>
>>> A         D - E
>>>
>>>   \
>>>
>>>      K
>>>
>>>
>>>
>>> Do I need the build the complete sequence for each startup sequence e.g.
>>>
>>>
>>>
>>> [A, B, D, E], [A, B, C], [A,K]
>>>
>>>
>>>
>>> I still not sure of the advantage this format has compared to the one we
>>> had before ?
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Martin
>>>
>>>
>>>
>>> *From:* Martin Eppel (meppel)
>>> *Sent:* Tuesday, May 12, 2015 5:45 PM
>>> *To:* Shaheedur Haque (shahhaqu); dev@stratos.apache.org
>>> *Cc:* Reka Thirunavukkarasu; Dakshika Jayathilaka
>>> *Subject:* RE: [Discuss] Fixing Comma Separated Dependency JSON
>>> Definitions
>>>
>>>
>>>
>>> Hi Imesh,
>>>
>>>
>>>
>>> Looking at your example :
>>>
>>> {
>>>
>>>    "startupOrders":[
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "cartridge.oracle1",
>>>
>>>             "cartridge.cassandra1",
>>>
>>>             "cartridge.tomcat1"
>>>
>>>          ]
>>>
>>>       },
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "cartridge.oracle1",
>>>
>>>             "cartridge.redis1"
>>>
>>>          ]
>>>
>>>       }
>>>
>>>    ],
>>>
>>>
>>>
>>>
>>>
>>> Just to confirm, does this mean the following ?
>>>
>>>
>>>
>>> *Oracle1** starts up first, when active -> cassandra1 and redis1 start
>>> up, when cassandra1 is active -> tomcat1 starts up* ?
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> Martin
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> *From:* Shaheedur Haque (shahhaqu)
>>> *Sent:* Tuesday, May 12, 2015 9:32 AM
>>> *To:* dev@stratos.apache.org
>>> *Cc:* Reka Thirunavukkarasu; Dakshika Jayathilaka; Martin Eppel (meppel)
>>> *Subject:* RE: [Discuss] Fixing Comma Separated Dependency JSON
>>> Definitions
>>>
>>>
>>>
>>> Let me come to the alias part in a moment, because I have thought about
>>> that last night J.
>>>
>>>
>>>
>>> The question I posed might be phrased like this:
>>>
>>>
>>>
>>> ·        My expectation is that startup orders were originally meant to
>>> be expressed as pairwise relationships.
>>>
>>> ·        So, I don’t understand the significance of the first part of
>>> your example (highlighted in red below).
>>>
>>> o   Is the idea that this is saying “start oracle1, then cassandra1 and
>>> then tomcat1”?
>>>
>>>
>>>
>>> The question about aliases is an interesting one. As you know, I
>>> disagree with the idea that aliases are used instead of the basic name in
>>> these constructs because from a user’s point of view, s/he only cares about
>>> the original names. AFAICS, aliases are a manifestation of the internal
>>> implementation of Stratos and do not belong in the public JSON. To the
>>> extent that they are already there, and already used for other stuff, does
>>> not justify proliferating their use.
>>>
>>>
>>>
>>> *From:* Imesh Gunaratne [mailto:imesh@apache.org <imesh@apache.org>]
>>> *Sent:* 12 May 2015 02:27
>>> *To:* dev
>>> *Cc:* Reka Thirunavukkarasu; Dakshika Jayathilaka
>>> *Subject:* Re: [Discuss] Fixing Comma Separated Dependency JSON
>>> Definitions
>>>
>>>
>>>
>>> Hi Shaheed,
>>>
>>>
>>>
>>> I'm sorry I did not get what you mean. Do you think we need to avoid
>>> using the "aliases" attribute and make the syntax as below?
>>>
>>>
>>>
>>> {
>>>
>>>    "startupOrders":[
>>>
>>>       [
>>>
>>>          "cartridge.oracle1",
>>>
>>>          "cartridge.cassandra1",
>>>
>>>          "cartridge.tomcat1"
>>>
>>>       ],
>>>
>>>       [
>>>
>>>          "cartridge.oracle1",
>>>
>>>          "cartridge.redis1"
>>>
>>>       ]
>>>
>>>    ],
>>>
>>>    "scalingDependents":[
>>>
>>>       [
>>>
>>>          "cartridge.redis1",
>>>
>>>          "cartridge.tomcat1"
>>>
>>>       ]
>>>
>>>    ]
>>>
>>> }
>>>
>>>
>>>
>>> On Tue, May 12, 2015 at 4:03 AM, Shaheedur Haque (shahhaqu) <
>>> shahhaqu@cisco.com> wrote:
>>>
>>> I’m confused by the new syntax. Originally, startup orders were pairs of
>>> comma separated strings, “A, B” implying an order between A and B, and that
>>> the change was simply to make it [“A”, “B”]. What does it mean when you
>>> have [“A”, “B”, “C”]:
>>>
>>>
>>>
>>> 1.      Is the order A then B then C?
>>>
>>> 2.      Is the meaning EXACTLY the same as specifying [“A”, “B”] and
>>> also [“B”, “C”]?
>>>
>>>
>>>
>>>
>>>
>>> *From:* Imesh Gunaratne [mailto:imesh@apache.org]
>>> *Sent:* 10 May 2015 10:37
>>> *To:* dev
>>> *Cc:* Shaheedur Haque (shahhaqu); Reka Thirunavukkarasu; Dakshika
>>> Jayathilaka
>>> *Subject:* Re: [Discuss] Fixing Comma Separated Dependency JSON
>>> Definitions
>>>
>>>
>>>
>>> I have now updated the Cartridge Group & Application creation pages in
>>> the UI with this modification:
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> On Sun, May 10, 2015 at 2:15 PM, Imesh Gunaratne <imesh@apache.org>
>>> wrote:
>>>
>>> I have now updated the API and the samples accordingly. The changes were
>>> pushed to master branch with the following commit revision:
>>>
>>> 112680a12ec5dc0a53d8253eb7818bf0e76adf07
>>>
>>>
>>>
>>> We need to update the UI with this modification.
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> On Sun, May 10, 2015 at 1:47 PM, Imesh Gunaratne <imesh@apache.org>
>>> wrote:
>>>
>>> It looks like I have made a mistake in the above sample when defining
>>> aliases. Aliases should either start with "cartridge." or "group.":
>>>
>>>
>>>
>>> {
>>>
>>>    "startupOrders":[
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "cartridge.oracle1",
>>>
>>>             "cartridge.cassandra1",
>>>
>>>             "cartridge.tomcat1"
>>>
>>>          ]
>>>
>>>       },
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "cartridge.oracle1",
>>>
>>>             "cartridge.redis1"
>>>
>>>          ]
>>>
>>>       }
>>>
>>>    ],
>>>
>>>    "scalingDependents":[
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "cartridge.redis1",
>>>
>>>             "cartridge.tomcat1"
>>>
>>>          ]
>>>
>>>       }
>>>
>>>    ]
>>>
>>> }
>>>
>>>
>>>
>>> On Sun, May 10, 2015 at 12:42 PM, Imesh Gunaratne <imesh@apache.org>
>>> wrote:
>>>
>>> A good point Chamila! IMO order of elements in array is by default
>>> preserved by CXF. We might need to verify it.
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> On Sun, May 10, 2015 at 12:12 PM, Chamila De Alwis <chamilad@wso2.com>
>>> wrote:
>>>
>>> Hi Imesh,
>>>
>>> Is the order among the array preserved during serialization and de
>>> serialization in JSON? Is it explicitly declared in the bean via
>>> JsonPropertyOrder annotation?
>>>
>>> On May 10, 2015 11:57 AM, "Imesh Gunaratne" <imesh@apache.org> wrote:
>>>
>>> Hi Devs,
>>>
>>>
>>>
>>> According to a suggestion made by Shaheed I have now updated the
>>> dependency JSON definitions (startup orders and scaling dependents) as
>>> follows:
>>>
>>>
>>>
>>> {
>>>
>>>    "startupOrders":[
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "oracle.oracle1",
>>>
>>>             "cassandra.cassandra1",
>>>
>>>             "tomcat.tomcat1"
>>>
>>>          ]
>>>
>>>       },
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "oracle.oracle1",
>>>
>>>             "redis.redis1"
>>>
>>>          ]
>>>
>>>       }
>>>
>>>    ],
>>>
>>>    "scalingDependents":[
>>>
>>>       {
>>>
>>>          "aliases":[
>>>
>>>             "redis.redis1",
>>>
>>>             "tomcat.tomcat1"
>>>
>>>          ]
>>>
>>>       }
>>>
>>>    ]
>>>
>>> }
>>>
>>>
>>>
>>> Please feel free to share your thoughts on this.
>>>
>>>
>>>
>>> Thanks
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>>
>>>
>>>
>>>
>>> --
>>>
>>> Imesh Gunaratne
>>>
>>>
>>>
>>> Senior Technical Lead, WSO2
>>>
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Mime
View raw message