You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hbase.apache.org by "Jonathan Gray (JIRA)" <ji...@apache.org> on 2009/07/28 21:38:14 UTC

[jira] Created: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

Put on client-side uses passed-in byte[]s rather than always using copies
-------------------------------------------------------------------------

                 Key: HBASE-1717
                 URL: https://issues.apache.org/jira/browse/HBASE-1717
             Project: Hadoop HBase
          Issue Type: Bug
          Components: client
    Affects Versions: 0.20.0
            Reporter: Jonathan Gray
            Assignee: Jonathan Gray
            Priority: Critical
             Fix For: 0.20.0


During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

      Resolution: Fixed
    Hadoop Flags: [Reviewed]
          Status: Resolved  (was: Patch Available)

v3 Committed.

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch, HBASE-1717-v2.patch, HBASE-1717-v3.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Status: Patch Available  (was: Open)

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch, HBASE-1717-v2.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

stack commented on HBASE-1717:
------------------------------

+1 on getting fresh instance of family to add to familymap but -1 on cloning KV.  KV is immutable.  If client makes KVs backed by a byte array of their own construction and then reuse,  then they will have issue.  You suggest javadoc'ing... That seems good to me.

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch, HBASE-1717-v2.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Status: Patch Available  (was: Open)

Review for commit.  I think KV cloning is the way to go.  If we don't, then we need to be very explicit in the javadocs about when you need to be sure not to touch passed values.  With this patch, we don't have to say anything because it copies everything.

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Attachment: HBASE-1717-v2.patch

Makes a copy of row during instantiation.  This couldn't cause issues we're seeing, but while we're being safe...

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch, HBASE-1717-v2.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Attachment: HBASE-1717-v1.patch

Uses local copy when using put(byte[], ...).  Makes a clone of KV when using put(KV).

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Status: Open  (was: Patch Available)

Should copy row passed in as well.

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (HBASE-1717) Put on client-side uses passed-in byte[]s rather than always using copies

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

Jonathan Gray updated HBASE-1717:
---------------------------------

    Attachment: HBASE-1717-v3.patch

Removes cloning of KV, adds javadoc to explain the passed KV must be immutable.

> Put on client-side uses passed-in byte[]s rather than always using copies
> -------------------------------------------------------------------------
>
>                 Key: HBASE-1717
>                 URL: https://issues.apache.org/jira/browse/HBASE-1717
>             Project: Hadoop HBase
>          Issue Type: Bug
>          Components: client
>    Affects Versions: 0.20.0
>            Reporter: Jonathan Gray
>            Assignee: Jonathan Gray
>            Priority: Critical
>             Fix For: 0.20.0
>
>         Attachments: HBASE-1717-v1.patch, HBASE-1717-v2.patch, HBASE-1717-v3.patch
>
>
> During review of Put with ryan, found that we are using a passed in reference to family in add() rather than a local copy.  If the backing array changed values, this could cause trouble.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.