Issue Details (XML | Word | Printable)

Key: HADOOP-3169
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Tsz Wo (Nicholas), SZE
Reporter: Tsz Wo (Nicholas), SZE
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Hadoop Common

LeaseChecker daemon should not be started in DFSClient constructor

Created: 03/Apr/08 11:50 PM   Updated: 08/Jul/09 04:43 PM
Return to search
Component/s: None
Affects Version/s: None
Fix Version/s: 0.19.0

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works 3169_20080718.patch 2008-07-18 10:38 PM Tsz Wo (Nicholas), SZE 7 kB
Text File Licensed for inclusion in ASF works 3169_20080721.patch 2008-07-21 09:20 PM Tsz Wo (Nicholas), SZE 9 kB
Text File Licensed for inclusion in ASF works 3169_20080723b.patch 2008-07-23 06:27 PM Tsz Wo (Nicholas), SZE 9 kB
Text File Licensed for inclusion in ASF works 3169_20080725.patch 2008-07-25 06:28 PM Tsz Wo (Nicholas), SZE 9 kB

Hadoop Flags: Reviewed
Resolution Date: 25/Jul/08 11:45 PM


 Description  « Hide
LeaseChecker daemon periodically renew leases with NameNode. However, if there is no file creation, LeaseChecker daemon should not be started for saving resources and better performance.

 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
Tsz Wo (Nicholas), SZE added a comment - 18/Jul/08 10:38 PM
3169_20080718.patch: start the lease checker daemon when the first file is created, not in the DFSClient constructor.

Tsz Wo (Nicholas), SZE added a comment - 21/Jul/08 09:20 PM
3169_20080721.patch: added a test and some messages.

Hairong Kuang added a comment - 22/Jul/08 11:56 PM
I feel that we do not need two locks, started and synchornized pendingCreates in LeaseChecker. Instead we can make put and remove synchronized.

Tsz Wo (Nicholas), SZE added a comment - 23/Jul/08 06:18 PM
I use two locks for protecting two objects, pendingCreate and daemon. You are right that it is possible to use one lock.

Tsz Wo (Nicholas), SZE added a comment - 23/Jul/08 06:27 PM
3169_20080723b.patch: only use one lock.

Raghu Angadi added a comment - 23/Jul/08 06:30 PM
+1 for simple locking using LeaseChecker object instead of AtomicBoolean and a synchronizedSortedMap.

Also should the LeaseChecker thread be closed when there are no leases pending for a few seconds or so? The justification is same as the one for delaying creation of the thread.


Tsz Wo (Nicholas), SZE added a comment - 23/Jul/08 08:38 PM
> Also should the LeaseChecker thread be closed when there are no leases pending for a few seconds or so? The justification is same as the one for delaying creation of the thread.

This is a good idea. Hairong also has suggested this before. This is useful if there are many clients (with different users) and all of them keep creating and closing files. It seems such case is not common. So we don't want to introduce complex codes to handle it.


Raghu Angadi added a comment - 23/Jul/08 08:52 PM
I agree this is not required. It is just an extension of what this jira already proposes to to to. An improvement over an improvement

> This is useful if there are many clients (with different users) and all of them keep creating and closing files.

I don't think this requires multiple clients or users. Imagine a case where a task writes one file and closes the file system. In that case, lease checker will stay as long as the task (because of FS cache) though there is one using it.

I did not mean to make it a requirement for this jira.


Tsz Wo (Nicholas), SZE added a comment - 24/Jul/08 11:32 PM
Passed tests locally, try hudson.

Hadoop QA added a comment - 25/Jul/08 10:43 AM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12386746/3169_20080723b.patch
against trunk revision 679601.

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

+1 tests included. The patch appears to include 4 new or modified tests.

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

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

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

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2949/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2949/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2949/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2949/console

This message is automatically generated.


Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 06:28 PM
3169_20080725.patch: updated with trunk.

Tsz Wo (Nicholas), SZE added a comment - 25/Jul/08 06:28 PM
Need to try hudson again

Hadoop QA added a comment - 25/Jul/08 09:57 PM
+1 overall. Here are the results of testing the latest attachment
http://issues.apache.org/jira/secure/attachment/12386907/3169_20080725.patch
against trunk revision 679879.

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

+1 tests included. The patch appears to include 4 new or modified tests.

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

+1 javac. The applied patch does not increase the total number of javac compiler warnings.

+1 findbugs. The patch does not introduce any new Findbugs warnings.

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

+1 core tests. The patch passed core unit tests.

+1 contrib tests. The patch passed contrib unit tests.

Test results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2954/testReport/
Findbugs warnings: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2954/artifact/trunk/build/test/findbugs/newPatchFindbugsWarnings.html
Checkstyle results: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2954/artifact/trunk/build/test/checkstyle-errors.html
Console output: http://hudson.zones.apache.org/hudson/job/Hadoop-Patch/2954/console

This message is automatically generated.


Hairong Kuang added a comment - 25/Jul/08 11:43 PM
+1. The patch looks good.

Hairong Kuang added a comment - 25/Jul/08 11:45 PM
I've just committed this. Thanks, Nicholas!

Hudson added a comment - 22/Aug/08 12:34 PM