helix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "kishore gopalakrishna (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HELIX-572) External view is recreated every time for bucketized resource
Date Sun, 08 Mar 2015 07:43:38 GMT

    [ https://issues.apache.org/jira/browse/HELIX-572?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14351965#comment-14351965
] 

kishore gopalakrishna commented on HELIX-572:
---------------------------------------------

For now, I will submit a patch to not delete the external view. I am assuming the reason we
were deleting earlier was to handle the change in number of buckets dynamically. I dont think
we can support changing them dynamically. We will have to re visit that again.

> External view is recreated every time for bucketized resource
> -------------------------------------------------------------
>
>                 Key: HELIX-572
>                 URL: https://issues.apache.org/jira/browse/HELIX-572
>             Project: Apache Helix
>          Issue Type: Bug
>          Components: helix-core
>    Affects Versions: 0.7.1, 0.6.4
>            Reporter: kishore gopalakrishna
>            Assignee: kishore gopalakrishna
>            Priority: Critical
>             Fix For: 0.6.5, 0.7.2
>
>
> If the resource is bucketized, controller first deletes the existing external view and
then recreates it. First of all this is inefficient and triggers a lot of unwanted changes.
> The code is i here ZKHelixDataAccessor
> {code}
>    case EXTERNALVIEW:
>         if (value.getBucketSize() == 0) {
>           records.add(value.getRecord());
>         } else {
>           _baseDataAccessor.remove(path, options);
> {code}
> Second, the external view change listeners stops listening to further changes.  This
may or may not happen all the time, but the probability of occurrence is pretty high.
> After EV is deleted, the listener gets a callback. The callback is handled by zkcallbackhandler.
When it gets a callback, it tries to set the watch again but the path may or may not exist
(depending on how fast the controller recreated the external view). If the path exists there
is not problem, but if it does not, we assume that the parent node is deleted and remove the
listener and invoke FINALIZE. Again this would not have happened if the resource was not bucketized.
> {code}
> @Override
>   public void handleChildChange(String parentPath, List<String> currentChilds)
{
>     try {
>       updateNotificationTime(System.nanoTime());
>       if (parentPath != null && parentPath.startsWith(_path)) {
>         NotificationContext changeContext = new NotificationContext(_manager);
>         if (currentChilds == null) {
>           // parentPath has been removed
>           if (parentPath.equals(_path)) {
>             // _path has been removed, remove this listener
>             _manager.removeListener(_propertyKey, _listener);
>           }
>           changeContext.setType(NotificationContext.Type.FINALIZE);
>         } else {
>           changeContext.setType(NotificationContext.Type.CALLBACK);
>         }
>         changeContext.setPathChanged(_path);
>         invoke(changeContext);
>       }
>     } catch (Exception e) {
>       String msg =
>           "exception in handling child-change. instance: " + _instanceName + ", parentPath:
"
>               + parentPath + ", listener: " + _listener;
>       ZKExceptionHandler.getInstance().handle(msg, e);
>     }
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message