Hi All,

I faced two issues while fixing this.

1. There is a method for clear cluster subscriptions
('closeAllClusterSubscriptionsOfNode()' in 'andesSubscriptionManager')
while initializing a cluster node. But it dosen't clean up database when
executed. Is there a specific reason not to delete non-durable
subscriptions from database when call this method?

2. Currently all subscriptions(durable/non-durable) are stored in
MB_DURABLE_SUBSCRIPTION table. Is there a reason for this? Can't we change
this table name to something meaningful if we continue to keep all
subscriptions in same table?

WDYT?

Thanks,
Pumudu

On Thu, Aug 13, 2015 at 2:41 PM, Pumudu Ruhunage <pum...@wso2.com> wrote:

> Hi All,
>
> Thanks for the inputs. +1 for implementing both cases.
> will do both implementations.
>
> Regards,
> Pumudu
>
> On Thu, Aug 13, 2015 at 11:40 AM, Hemika Kodikara <hem...@wso2.com> wrote:
>
>> Hi All,
>>
>> We have already done a similar implementation for durable topics on
>> member removed.
>>
>> +1 for Asanka's suggestion to remove non-topic subscriptions on both
>> occasions.
>>
>> Regards,
>> Hemika
>>
>> Hemika Kodikara
>> Software Engineer
>> WSO2 Inc.
>> lean . enterprise . middleware
>> http://wso2.com
>>
>> Mobile : +94777688882
>>
>> On Thu, Aug 13, 2015 at 11:09 AM, Asitha Nanayakkara <asi...@wso2.com>
>> wrote:
>>
>>>
>>> On Thu, Aug 13, 2015 at 3:17 PM, Asanka Abeyweera <asank...@wso2.com>
>>> wrote:
>>>
>>>> Hi Asitha,
>>>>
>>>> I don't think we can achieve this by only doing the cleanup at the
>>>> coordinator selection point. We have to clean the topic subscriptions for a
>>>> non-coordinator node when it leaves (In this case a new coordinator will
>>>> not be elected).
>>>>
>>>> Oh! yes agreed!
>>>
>>>>
>>>> On Thu, Aug 13, 2015 at 5:04 AM, Asitha Nanayakkara <asi...@wso2.com>
>>>> wrote:
>>>>
>>>>>
>>>>>
>>>>> On Wed, Aug 12, 2015 at 10:53 PM, Asanka Abeyweera <asank...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Pumudu,
>>>>>>
>>>>>> I think we have to do the clean up in both places. Case 1 is required
>>>>>> when the only node in the cluster leaves and come back. Case 2 is 
>>>>>> required
>>>>>> when a single node leaves in a multi node cluster.
>>>>>>
>>>>>> On Wed, Aug 12, 2015 at 5:38 PM, Pumudu Ruhunage <pum...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> Currently if MB node got killed unexpectedly non-durable topic
>>>>>>> subscriptions bind to that node will remain in cluster. This can cause
>>>>>>> unexpected behaviors in cluster since that node has already removed.
>>>>>>>
>>>>>>> IMO these topic subscriptions can clean up in two methods.
>>>>>>>
>>>>>>> 1. During each MB node start up, remove all non-durable topic
>>>>>>> subscriptions for it's local node id. (This will ensure newly started 
>>>>>>> node
>>>>>>> won't receive any non-durable topic messages related to previously 
>>>>>>> killed
>>>>>>> MB node with same node id)
>>>>>>>
>>>>>>
>>>>>> I think  we can do this in org.wso2.andes.kernel.AndesKernelBoot or
>>>>>> in a similar class. May be we can do this similar to the way we do the 
>>>>>> slot
>>>>>> recovery task.
>>>>>>
>>>>>>>
>>>>>>>
>>>>>> 2. Cluster coordinator should remove all non-durable topic
>>>>>>> subscriptions when a member left from cluster. (This can be a problem if
>>>>>>> coordinator node killed. If there's a method to get previous coordinator
>>>>>>> node id by newly elected coordinator this method can be implemented)
>>>>>>>
>>>>>>
>>>>>> For this case we can do the clean up in
>>>>>> org.wso2.andes.server.cluster.ClusterManager#memberRemoved method after
>>>>>> checking if the current node is the coordinator. This will work even if 
>>>>>> the
>>>>>> coordinator node get killed.
>>>>>>
>>>>>
>>>>> When a new coordinator is elected can't we let that newly elected
>>>>> coordinator do this ? Even at startup there is a coordinator election
>>>>> right? if that's the case we can cover both scenarios IMO?
>>>>>
>>>>>
>>>>>>>
>>>>>> How should we do the clean up. WDYT?
>>>>>>>
>>>>>>> Regards,
>>>>>>> Pumudu
>>>>>>> --
>>>>>>> Pumudu Ruhunage
>>>>>>> Associate Software Engineer | WSO2 Inc
>>>>>>> M: +94 779 664493  | http://wso2.com
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Dev mailing list
>>>>>>> Dev@wso2.org
>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Asanka Abeyweera
>>>>>> Software Engineer
>>>>>> WSO2 Inc.
>>>>>>
>>>>>> Phone: +94 712228648
>>>>>> Blog: a5anka.github.io
>>>>>>
>>>>>> _______________________________________________
>>>>>> Dev mailing list
>>>>>> Dev@wso2.org
>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Asitha Nanayakkara*
>>>>> Software Engineer
>>>>> WSO2, Inc. http://wso2.com/
>>>>> Mob: + 94 77 85 30 682
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Asanka Abeyweera
>>>> Software Engineer
>>>> WSO2 Inc.
>>>>
>>>> Phone: +94 712228648
>>>> Blog: a5anka.github.io
>>>>
>>>
>>>
>>>
>>> --
>>> *Asitha Nanayakkara*
>>> Software Engineer
>>> WSO2, Inc. http://wso2.com/
>>> Mob: + 94 77 85 30 682
>>>
>>>
>>> _______________________________________________
>>> Dev mailing list
>>> Dev@wso2.org
>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>
>>>
>>
>> _______________________________________________
>> Dev mailing list
>> Dev@wso2.org
>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>
>>
>
>
> --
> Pumudu Ruhunage
> Associate Software Engineer | WSO2 Inc
> M: +94 779 664493  | http://wso2.com
>



-- 
Pumudu Ruhunage
Associate Software Engineer | WSO2 Inc
M: +94 779 664493  | http://wso2.com
_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to