You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Terry Siu (JIRA)" <ji...@apache.org> on 2011/07/01 01:03:28 UTC

[jira] [Created] (HBASE-4051) Table coprocessor loaded twice when region is initialized

Table coprocessor loaded twice when region is initialized
---------------------------------------------------------

                 Key: HBASE-4051
                 URL: https://issues.apache.org/jira/browse/HBASE-4051
             Project: HBase
          Issue Type: Bug
          Components: coprocessors
    Affects Versions: 0.92.0
         Environment: Ubuntu 11.04 64-bit
            Reporter: Terry Siu
             Fix For: 0.92.0


I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 

1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 

2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 

This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 

Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-4051:
----------------------------------

    Attachment: HBASE-4051.patch

Might have been a merge gaffe.

Testing attached patch.

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-4051:
----------------------------------

    Status: Patch Available  (was: Open)

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>            Assignee: Andrew Purtell
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Terry Siu (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13058649#comment-13058649 ] 

Terry Siu commented on HBASE-4051:
----------------------------------

Thanks for the prompt response, Andrew! Patched it in and it looks great!

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>            Assignee: Andrew Purtell
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Terry Siu (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Terry Siu updated HBASE-4051:
-----------------------------

    Summary: [Coprocessors] Table coprocessor loaded twice when region is initialized  (was: Table coprocessor loaded twice when region is initialized)

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>             Fix For: 0.92.0
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Updated] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell updated HBASE-4051:
----------------------------------

    Resolution: Fixed
        Status: Resolved  (was: Patch Available)

Committed. Tests pass, including our coprocessor-based access control. 

Thanks for the bug report Terry!

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>            Assignee: Andrew Purtell
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Assigned] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Andrew Purtell (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Andrew Purtell reassigned HBASE-4051:
-------------------------------------

    Assignee: Andrew Purtell

> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>            Assignee: Andrew Purtell
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

[jira] [Commented] (HBASE-4051) [Coprocessors] Table coprocessor loaded twice when region is initialized

Posted by "Hudson (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/HBASE-4051?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13058219#comment-13058219 ] 

Hudson commented on HBASE-4051:
-------------------------------

Integrated in HBase-TRUNK #1999 (See [https://builds.apache.org/job/HBase-TRUNK/1999/])
    HBASE-4051 Table coprocessor loaded twice when region is initialized

apurtell : 
Files : 
* /hbase/trunk/src/main/java/org/apache/hadoop/hbase/regionserver/RegionCoprocessorHost.java
* /hbase/trunk/CHANGES.txt


> [Coprocessors] Table coprocessor loaded twice when region is initialized
> ------------------------------------------------------------------------
>
>                 Key: HBASE-4051
>                 URL: https://issues.apache.org/jira/browse/HBASE-4051
>             Project: HBase
>          Issue Type: Bug
>          Components: coprocessors
>    Affects Versions: 0.92.0
>         Environment: Ubuntu 11.04 64-bit
>            Reporter: Terry Siu
>            Assignee: Andrew Purtell
>             Fix For: 0.92.0
>
>         Attachments: HBASE-4051.patch
>
>
> I'm debugging a prePut hook which I've implemented as part of the coprocessor work being developed. This hook is loaded via a table COPROCESSOR attribute and I've noticed that the prePut method is being called twice for a single Put. After setting up the region server to run in a debugger, I'm noticing the call to loadTableCoprocessors() being invoked twice during region initialization, specifically: 
> 1.       HRegion.init => RegionCoprocessorHost.init => RegionCoprocessorHost.loadTableCoprocessors 
> 2.       ... => RegionCoprocessorHost.preOpen => RegionCoprocessorHost.loadTableCoprocessors 
> This results in two RegionEnvironment instances, each containing a new instance of my coprocessor, being added to the RegionCoprocessorHost. When I issue a put, the list of RegionEnvironments is iterated over and each calls the prePut method in my coprocessor. Reason why this is posing a problem for me is that I modify the family map passed in to my prePut method. Since this family map is the same instance used in both prePut calls, the second prePut call operates on the modified family map, which leads to an unexpected result. 
> Is the double loading of the same coprocessor class intentional, is this a bug?

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira