cloudstack-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alena Prokharchyk <>
Subject Re: Control event publishing in multi region setups
Date Thu, 08 May 2014 18:00:18 GMT
Bringing the email thread to the mailing list. Didn’t include it earlier not knowing that
the original question will result in argumentative discussion. The thread is regarding


From: Alex Huang <<>>
Date: Thursday, May 8, 2014 at 10:43 AM
To: Alex Ough <<>>, Murali
Reddy <<>>
Cc: Alena Prokharchyk <<>>,
Kishan Kavala <<>>
Subject: RE: Control event publishing in multi region setups

Hi Alex,

Please know that the contribution is much appreciated.  It is not a case of whether or not
Alena “wants” or “doesn’t want” to approve the review.  She can only approve if
the design is sound and has no regression for existing deployments of CloudStack.

This is a blocker because not publishing events when an account is propagated is actually
an “incorrect” behavior for CloudStack.  Any functionality that acts on an account creation
within the region will face regression.  That’s why it is not “an additional feature”
and must be fixed.  Think of SunGuard itself.  If it was depending on the account creation
event and the next version of CloudStack suddenly doesn’t generate the event consistently,
would it not consider this a bug and ask us to fix it?

I do understand the time consuming nature of providing patches and merging code.  Alena tells
me that she has reviewed the code and she thinks the design is fine except for this one item.
 If we can commit to fix this problem after the code is checked in, we can check it in now
just so you don’t have to do another round of merge and review for the part that is working.
 But the fix will need to be in before the code is released or else we might have to revert
this checkin.  What do you think?

P.S. I’m not sure why this is not on the dev list.  We should bring this back.

From: Alex Ough []
Sent: Wednesday, May 7, 2014 4:58 PM
To: Murali Reddy
Cc: Alena Prokharchyk; Alex Huang; Kishan Kavala
Subject: Re: Control event publishing in multi region setups


Alena doesn't want to approve my implementation because of this email thread, but I'm frustrated
and not sure why this is a blocker.
What I did was just created another method without an event tag like the one already existing
in 'AccountManagerImpl' class as below.

public boolean enableAccount(long accountId)

And if we need this feature, we really need to create a new jira instead of adding it to already
existing one
so that we can discuss options to find a best solution.

It's been a really long path mostly because of miscommunications, and I really want to wrap
this up without adding a new feature that is not existing.

Let me know what you think.
Alex Ough

On Wed, May 7, 2014 at 10:29 AM, Murali Reddy <<>>
I don’t think we need to bring back reverted changes, as we want all the events generated
should be published all the time with in the region. I agree with Alex Huang, that we could
actually add details (originating region) to the account indicating source region where account
is created. Details particular to an event published on the event bus is a JSON object so
we can add additional details. Also steps listed out by Alex should prevent from cyclic propagation.

Alex Ough,

Suggested steps below by alex should work for you. Do you see any problem with that?


From: Alena Prokharchyk <<>>
Date: Wednesday, 7 May 2014 5:56 AM
To: Alex Huang <<>>, Alex Ough
<<>>, Kishan Kavala <<>>,
Murali Reddy <<>>

Subject: Re: Control event publishing in multi region setups

Alex (Huang), thanks for commenting.  As a conclusion – we should never omit event firing
when submit create/update.

Kishan/Murali, can you please help Alex (Ough) to figure out how to implement the behavior
Kishan reverted. Kishan, can you check with Murali how to bring back your reverted changes
for the API to make it work with the new events framework?

Thank you,
From: Alex Huang <<>>
Date: Tuesday, May 6, 2014 at 10:17 AM
To: Alena Prokharchyk <<>>,
Alex Ough <<>>
Cc: Kishan Kavala <<>>
Subject: RE: Control event publishing in multi region setups

Hey guys,

I’m not sure we’re all on the same page.

First, the event must always be published, regardless of if it was propagated from another
region or created originally in that region.  The reason is there may be other code interested
in acting on account creation in a region.  We just need to provide a way for Alex’s code
to determine that the account is propagated rather than created originally in the region.
 You don’t need details in the event for that.

The propagation code can do the following.  It’s probably already doing that.

1.       Listen for the account creation event.

2.       Upon receiving an account creation event, retrieve the account to check if the account
is propagated or created.

3.       If propagated, then don’t propagate or maybe even signal back that the propagation
is done for this region (depending on the propagation logic).  If created, then propagate
to other regions.

Now the detail is in how do we know if an account is created or propagated.  For that, it
can be done in a number of ways.  I’m open to which method.  I would suggest that we add
two fields to account: origination region and original uuid.  The create account API takes
an optional fields for the origination region and origination account uuid.  If these two
parameters are not set in the API, the API set the origination region to the current region
and the original uuid to the uuid of the account.

Sorry for the confusion here.  I had thought Kishan added this but apparently it has been


From: Alena Prokharchyk
Sent: Tuesday, May 6, 2014 9:57 AM
To: Alex Ough
Cc: Kishan Kavala; Alex Huang
Subject: Re: Control event publishing in multi region setups

Ok, thank you Alex, so looks like there is no other workaround as of now rather than introducing
the new methods to the managers. Just go ahead and submit the rest of the fixes for both review
tickets, and I will commit the patch after that.


From: Alex Ough <<>>
Date: Tuesday, May 6, 2014 at 9:48 AM
To: Alena Prokharchyk <<>>
Cc: Kishan Kavala <<>>,
Alex Huang <<>>
Subject: Re: Control event publishing in multi region setups

I'm afraid it is not possible because the events are set in the method level and one of my
colleagues implemented to enable/disable events, but this is working as globally.

On Tue, May 6, 2014 at 12:44 PM, Alena Prokharchyk <<>>
Kishan, any updates from Murali? All we need to know is – if controlling events possible
when command is fired through CS client APIs today.

Thank you!

From: Kishan Kavala <<>>
Date: Tuesday, May 6, 2014 at 7:22 AM
To: Alena Prokharchyk <<>>
Cc: Alex Ough <<>>, Alex
Huang <<>>

Subject: Re: Control event publishing in multi region setups

 Events are published using the event framework introduced by Murali. It can contain additional
details to indicate whether an event should be propagated to other regions.
 In the implementation I added using API sync, there was a flag in the API params to indicate
whether to propagate event or not. I reverted this code later when we moved to use event framework.
  I'll check with Murali for more details regarding adding custom details / extending event

On 06-May-2014, at 4:52 am, "Alena Prokharchyk" <<>>
Alex, I understand that. But if Kishan implemented the way of extending the events with the
details that can be later on read by events recipient, then you should be able to use the

If there is no such support, the I agree that the way you do it now, is the only one way to
achieve the desired functionality.


From: Alex Ough <<>>
Date: Monday, May 5, 2014 at 4:08 PM
To: Alex Huang <<>>
Cc: Alena Prokharchyk <<>>,
Kishan Kavala <<>>
Subject: Re: Control event publishing in multi region setups

That's exactly why I need methods that do NOT generate events when the create/update/delete
is just for local resources.

On Mon, May 5, 2014 at 7:06 PM, Alex Huang <<>>
That’s actually what I said.  Let me clarify.  When Kishan added the region feature, we
discussed the problem of infinite circular propagation because each management server that
adds an account will attempt to propagate it to all the regions by adding it to that region
and so on.  The API needs provide a way for that propagation to be terminated.  That doesn’t
mean we don’t publish the event in the region where the account is propagated to.  We still
should publish the event because that region did add a new account but the event needs to
contain enough details for anyone listening to the event to determine that they should not
propagate the account creation.


From: Alena Prokharchyk
Sent: Monday, May 5, 2014 2:39 PM
To: Kishan Kavala; Alex Ough
Cc: Alex Huang
Subject: Control event publishing in multi region setups


Have a question to you. Alex Huang mentioned to me that you were planning to add support for
controlling event publishing in multi regions setup. So you can control whether you want to
publish the event in a particular region when create/update/delete account/domain API call
is made. Can you please tell us if you’ve implemented it? And what parameters need to be
passed to the API call to achieve that.

Alex (Ought), if Kishan didn’t implement this, then I agree with the way you’ve added
new methods to Account/DomainManagers to do the object update w/o the event generation. Lets
wait for Kishan’s reply. By now, you can go ahead and fix 1) and 2) in
which is not related to event generation.

Thank you!

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message