[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-23 Thread Hadoop QA (JIRA)

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

Hadoop QA commented on HBASE-5329:
--

-1 overall.  Here are the results of testing the latest attachment 
  http://issues.apache.org/jira/secure/attachment/12542080/5329-v2.patch
  against trunk revision .

+1 @author.  The patch does not contain any @author tags.

-1 tests included.  The patch doesn't appear to include any new or modified 
tests.
Please justify why no new tests are needed for this 
patch.
Also please list what manual steps were performed to 
verify this patch.

+1 hadoop2.0.  The patch compiles against the hadoop 2.0 profile.

+1 javadoc.  The javadoc tool did not generate any warning messages.

-1 javac.  The applied patch generated 5 javac compiler warnings (more than 
the trunk's current 4 warnings).

-1 findbugs.  The patch appears to introduce 7 new Findbugs (version 1.3.9) 
warnings.

+1 release audit.  The applied patch does not increase the total number of 
release audit warnings.

 -1 core tests.  The patch failed these unit tests:
   
org.apache.hadoop.hbase.io.hfile.TestForceCacheImportantBlocks
  
org.apache.hadoop.hbase.backup.example.TestZooKeeperTableArchiveClient
  org.apache.hadoop.hbase.master.TestSplitLogManager

Test results: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//testReport/
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop2-compat.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-server.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop1-compat.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-common.html
Findbugs warnings: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//artifact/trunk/patchprocess/newPatchFindbugsWarningshbase-hadoop-compat.html
Console output: 
https://builds.apache.org/job/PreCommit-HBASE-Build/2658//console

This message is automatically generated.

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Ian Varley
Priority: Minor
 Fix For: 0.96.0

 Attachments: 5329-v2.patch, HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-23 Thread Zhihong Ted Yu (JIRA)

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

Zhihong Ted Yu commented on HBASE-5329:
---

I ran TestSplitLogManager#testOrphanTaskAcquisition manually and it passed.

Integrated to trunk.

Thanks for the patch, Ian.

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Ian Varley
Priority: Minor
 Fix For: 0.96.0

 Attachments: 5329-v2.patch, HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-23 Thread Hudson (JIRA)

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

Hudson commented on HBASE-5329:
---

Integrated in HBase-TRUNK #3257 (See 
[https://builds.apache.org/job/HBase-TRUNK/3257/])
HBASE-5329 addRowLock() may allocate duplicate lock id, causing the client 
to be blocked (Ian Varley) (Revision 1376489)

 Result = SUCCESS
Tedyu : 
Files : 
* 
/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java


 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Ian Varley
Priority: Minor
 Fix For: 0.96.0

 Attachments: 5329-v2.patch, HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-23 Thread Hudson (JIRA)

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

Hudson commented on HBASE-5329:
---

Integrated in HBase-TRUNK-on-Hadoop-2.0.0 #144 (See 
[https://builds.apache.org/job/HBase-TRUNK-on-Hadoop-2.0.0/144/])
HBASE-5329 addRowLock() may allocate duplicate lock id, causing the client 
to be blocked (Ian Varley) (Revision 1376489)

 Result = FAILURE
Tedyu : 
Files : 
* 
/hbase/trunk/hbase-server/src/main/java/org/apache/hadoop/hbase/regionserver/HRegionServer.java


 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Ian Varley
Priority: Minor
 Fix For: 0.96.0

 Attachments: 5329-v2.patch, HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-22 Thread Ian Varley (JIRA)

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

Ian Varley commented on HBASE-5329:
---

Agree with Lars on the extreme unlikeliness of this. But also agree with Ted; 
the putIfAbsent pattern should be an easy default for all things like this, 
rather than even discussing it. (Especially since we've already got a 
ConcurrentMap here). Attaching a casual patch that does that. (You may not like 
the do loop style, feel free to replace with something you find more readable.)

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Ted Yu
Priority: Minor
 Attachments: HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-22 Thread Zhihong Ted Yu (JIRA)

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

Zhihong Ted Yu commented on HBASE-5329:
---

Thanks for activating this JIRA.
{code}
+ do {
+  lockName = String.valueOf(nextLong());
+ } while (rowlocks.putIfAbsent(lockName, r) != null);
{code}
Indentation is off for the above block.
{code}
+return Long.parseLong(lockName);
{code}
I prefer the old way of keeping long lockId so that the above parsing can be 
omitted.

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Ted Yu
Priority: Minor
 Attachments: HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-08-22 Thread Ian Varley (JIRA)

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

Ian Varley commented on HBASE-5329:
---

Cool, thanks for the updated patch Ted. Agreed about the lockId change, that's 
clearer. Thanks!

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Ian Varley
Priority: Minor
 Fix For: 0.96.0

 Attachments: 5329-v2.patch, HBASE-5329.patch


 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-02-10 Thread liaoxiangui (Commented) (JIRA)

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

liaoxiangui commented on HBASE-5329:


sorry, i didn`t describle it clearly.
I thinks there is possibility that Random.nextLong() generate same number.
To get consequences what the same number lead to, I changed code follow this, 
and got the Leases$LeaseStillHeldException.

{code}
protected long addRowLock(Integer r, HRegion region) throws 
LeaseStillHeldException
{
long lockId = -1L;
lockId = 99; 
String lockName = String.valueOf(lockId);
rowlocks.put(lockName, r);
this.leases.createLease(lockName, new RowLockListener(lockName, 
region));
return lockId;
}
{code}

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Yu
Priority: Critical

 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-02-04 Thread Lars Hofhansl (Commented) (JIRA)

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

Lars Hofhansl commented on HBASE-5329:
--

Even if you get 1000 scanners per second you'd have to do that for 1 trillion 
(1.000.000.000) years to come into the ballpark of 2^64.

The laws of big numbers are not intuitive.

It is billions times more likely that your power fails, there're random bit 
errors, your harddrive dies, or datacenter is hit my a meteorite :).
From that viewpoint this is in fact not possible, because your hardware is not 
going to live long enough to experience this.

I really think we do not have to change this.


 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Yu
Priority: Critical

 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-02-03 Thread Ming Ma (Commented) (JIRA)

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

Ming Ma commented on HBASE-5329:


It seems addScanner() might have similar issue.

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Priority: Critical

 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-02-03 Thread Lars Hofhansl (Commented) (JIRA)

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

Lars Hofhansl commented on HBASE-5329:
--

I had raised that fact about getScanner() a while ago... Isn't that 
*incredibly* unlikely, though.
nextLong generates all 2^64 possible longs with roughly equal probability.
The chances of the same long being generated are astronomically small.

From the log attached, you actually saw this happening? Are you sure this due 
to a duplicate random number?


 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Yu
Priority: Critical

 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira




[jira] [Commented] (HBASE-5329) addRowLock() may allocate duplicate lock id, causing the client to be blocked

2012-02-03 Thread Zhihong Yu (Commented) (JIRA)

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

Zhihong Yu commented on HBASE-5329:
---

Although rare, this is possible - considering duplicate scanner Id with lock 
Id, etc.
Here is related code:
{code}
  if (leases.containsKey(lease.getLeaseName())) {
throw new LeaseStillHeldException(lease.getLeaseName());
  }
{code}

 addRowLock() may allocate duplicate lock id, causing the client to be blocked
 -

 Key: HBASE-5329
 URL: https://issues.apache.org/jira/browse/HBASE-5329
 Project: HBase
  Issue Type: Bug
  Components: regionserver
Affects Versions: 0.90.3
 Environment: Red Hat Enterprise Linux Server release 5.4 
Reporter: liaoxiangui
Assignee: Zhihong Yu
Priority: Critical

 {code}
 protected long addRowLock(Integer r, HRegion region) throws 
 LeaseStillHeldException
 {
   long lockId = -1L;
   lockId = rand.nextLong();   //!!!may generate duplicated 
 id,bug?
   String lockName = String.valueOf(lockId);
   rowlocks.put(lockName, r);
   this.leases.createLease(lockName, new RowLockListener(lockName, 
 region));
   return lockId;
 }
 {code}
 In addRowLock(),rand may generate duplicated lock id, it may cause 
 regionserver throw exception(Leases$LeaseStillHeldException).The client will 
 be blocked until old rowlock is released.
 {code}
 2012-02-03 15:21:50,084 ERROR 
 org.apache.hadoop.hbase.regionserver.HRegionServer: Error obtaining row lock 
 (fsOk: true)
 org.apache.hadoop.hbase.regionserver.Leases$LeaseStillHeldException
 at 
 org.apache.hadoop.hbase.regionserver.Leases.createLease(Leases.java:150)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.addRowLock(HRegionServer.java:1986)
 at 
 org.apache.hadoop.hbase.regionserver.HRegionServer.lockRow(HRegionServer.java:1963)
 at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
 at 
 sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
 at 
 sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
 at java.lang.reflect.Method.invoke(Method.java:597)
 at org.apache.hadoop.hbase.ipc.HBaseRPC$Server.call(HBaseRPC.java:570)
 at 
 org.apache.hadoop.hbase.ipc.HBaseServer$Handler.run(HBaseServer.java:1039)
 {code}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: 
https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira