[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13452235#comment-13452235
 ] 

Nicolas Thiébaud commented on HBASE-6725:
-

The bug comes from the fact that checkAndMutate uses getLock(lockId, 
get.getRow(), true) and resuses the provided lock. Since several client threads 
use the same lock many are allowed to mutate.

I believe there are 2 solutions:
a. Use some sort of internal lock, which requires a specific lock set for check 
and mutate
b. Consider CAP with locks as bad usage of locks and deprecate the feature.

I'm willing to contribute for this patch, but I'm not sure how to go on from 
now.

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When multiple threads race using CAP with and a lock on the same row, several 
 instances may be allowed to update the cell with the new value (although the 
 expected value is different).
 If all threads race with a wrong expected value and a lock, none will be able 
 to update.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-10 Thread Ted Yu (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13452246#comment-13452246
 ] 

Ted Yu commented on HBASE-6725:
---

@Nicolas:
Thanks for the finding.

For point b, can you write a summary on dev@ list to poll people's opinion ?

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When multiple threads race using CAP with and a lock on the same row, several 
 instances may be allowed to update the cell with the new value (although the 
 expected value is different).
 If all threads race with a wrong expected value and a lock, none will be able 
 to update.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-10 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13452513#comment-13452513
 ] 

Nicolas Thiébaud commented on HBASE-6725:
-

Done.

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When multiple threads race using CAP with and a lock on the same row, several 
 instances may be allowed to update the cell with the new value (although the 
 expected value is different).
 If all threads race with a wrong expected value and a lock, none will be able 
 to update.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-08 Thread JIRA

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13451272#comment-13451272
 ] 

Nicolas Thiébaud commented on HBASE-6725:
-

It also fails with non-empty expected value. I'm going to try to find the bug 
and provide a patch.

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When using CAP with an empty array as expected value and using a lock on the 
 corresponding row, hbase may allow a Put even if the value was already there. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-07 Thread Ted Yu (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13450781#comment-13450781
 ] 

Ted Yu commented on HBASE-6725:
---

I tried the test against 0.92 and trunk:
{code}
Failed tests:   
testConcurrentCAPWithLocks(org.apache.hadoop.hbase.client.TestConcurrentCAPWithLocks):
 expected:5 but was:1
{code}

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When using CAP with an empty array as expected value and using a lock on the 
 corresponding row, hbase may allow a Put even if the value was already there. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-07 Thread Ted Yu (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13450819#comment-13450819
 ] 

Ted Yu commented on HBASE-6725:
---

nit:
{code}
for(int c : counts) Assert.assertEquals(c, 1);
{code}
c and 1 should be exchanged so that the assertion failure is clear to the user.

Does this only fail with an empty array as expected value ?

It would be nice if you can provide patch for this issue.

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip, TestCase_HBASE_6725.patch


 When using CAP with an empty array as expected value and using a lock on the 
 corresponding row, hbase may allow a Put even if the value was already there. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


[jira] [Commented] (HBASE-6725) Check and Put can fail when using locks

2012-09-06 Thread Ted Yu (JIRA)

[ 
https://issues.apache.org/jira/browse/HBASE-6725?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=13449875#comment-13449875
 ] 

Ted Yu commented on HBASE-6725:
---

@Nicolas:
Can you format ConcurrentCAPWithLocks class as a proper test so that we can 
easily verify this bug ?

Thanks

 Check and Put can fail when using locks
 ---

 Key: HBASE-6725
 URL: https://issues.apache.org/jira/browse/HBASE-6725
 Project: HBase
  Issue Type: Bug
  Components: master
Affects Versions: 0.90.4
 Environment: tested on mac os x
Reporter: Nicolas Thiébaud
 Attachments: CAPwithLocks.zip


 When using CAP with an empty array as expected value and using a lock on the 
 corresponding row, hbase may allow a Put even if the value was already there. 

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira