Uploaded image for project: 'Hadoop HDFS'
  1. Hadoop HDFS
  2. HDFS-4191

Track new transactions per thread so that unnecessary logSync() calls can be avoided

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Won't Fix
    • Affects Version/s: 3.0.0-alpha1
    • Fix Version/s: None
    • Component/s: namenode
    • Labels:
    • Target Version/s:

      Description

      With this fix, logSync() can be called anytime by a thread without affecting the batched syncs metrics. As discussed in HDFS-4186, we will put this feature only to trunk first and let it soak for some time.

      1. hdfs-4191-trunk.patch
        4 kB
        Kihwal Lee
      2. hdfs-4191-trunk.patch
        4 kB
        Kihwal Lee

        Activity

        Hide
        kihwal Kihwal Lee added a comment -

        I don't think there is much benefit in this change.

        Show
        kihwal Kihwal Lee added a comment - I don't think there is much benefit in this change.
        Hide
        hadoopqa Hadoop QA added a comment -



        -1 overall



        Vote Subsystem Runtime Comment
        -1 patch 0m 0s The patch command could not apply the patch during dryrun.



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12560467/hdfs-4191-trunk.patch
        Optional Tests javadoc javac unit findbugs checkstyle
        git revision trunk / f1a152c
        Console output https://builds.apache.org/job/PreCommit-HDFS-Build/10529/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - -1 overall Vote Subsystem Runtime Comment -1 patch 0m 0s The patch command could not apply the patch during dryrun. Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12560467/hdfs-4191-trunk.patch Optional Tests javadoc javac unit findbugs checkstyle git revision trunk / f1a152c Console output https://builds.apache.org/job/PreCommit-HDFS-Build/10529/console This message was automatically generated.
        Hide
        hadoopqa Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12560467/hdfs-4191-trunk.patch
        against trunk revision .

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

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

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

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any 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 passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/3641//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/3641//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12560467/hdfs-4191-trunk.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any 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 passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/3641//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/3641//console This message is automatically generated.
        Hide
        kihwal Kihwal Lee added a comment -

        Thanks for the review, Todd. Posting an updated patch.

        Show
        kihwal Kihwal Lee added a comment - Thanks for the review, Todd. Posting an updated patch.
        Hide
        tlipcon Todd Lipcon added a comment -
        -    TransactionId(long value) {
        +    TransactionId(long value, boolean needToSync) {
               this.txid = value;
        +      this.hasTransToSync = needToSync;
        

        Given this is only constructed with needToSync == false, I think we can just have the constructor set it to false, rather than taking in the argument.


        +  void setHasTransToSync(boolean sync) {
        

        Can you rename to setHasTransToSyncForTests so that we're careful not to use this elsewhere? The @VisibleForTesting annotation is good but it's easy to miss it and end up using these types of functions in the production code.

        Otherwise looks good to me.

        Show
        tlipcon Todd Lipcon added a comment - - TransactionId( long value) { + TransactionId( long value, boolean needToSync) { this .txid = value; + this .hasTransToSync = needToSync; Given this is only constructed with needToSync == false, I think we can just have the constructor set it to false, rather than taking in the argument. + void setHasTransToSync( boolean sync) { Can you rename to setHasTransToSyncForTests so that we're careful not to use this elsewhere? The @VisibleForTesting annotation is good but it's easy to miss it and end up using these types of functions in the production code. Otherwise looks good to me.
        Hide
        hadoopqa Hadoop QA added a comment -

        +1 overall. Here are the results of testing the latest attachment
        http://issues.apache.org/jira/secure/attachment/12553783/hdfs-4191-trunk.patch
        against trunk revision .

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

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

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

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

        +1 eclipse:eclipse. The patch built with eclipse:eclipse.

        +1 findbugs. The patch does not introduce any 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 passed unit tests in hadoop-hdfs-project/hadoop-hdfs.

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

        Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/3525//testReport/
        Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/3525//console

        This message is automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall . Here are the results of testing the latest attachment http://issues.apache.org/jira/secure/attachment/12553783/hdfs-4191-trunk.patch against trunk revision . +1 @author . The patch does not contain any @author tags. +1 tests included . The patch appears to include 1 new or modified test files. +1 javac . The applied patch does not increase the total number of javac compiler warnings. +1 javadoc . The javadoc tool did not generate any warning messages. +1 eclipse:eclipse . The patch built with eclipse:eclipse. +1 findbugs . The patch does not introduce any 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 passed unit tests in hadoop-hdfs-project/hadoop-hdfs. +1 contrib tests . The patch passed contrib unit tests. Test results: https://builds.apache.org/job/PreCommit-HDFS-Build/3525//testReport/ Console output: https://builds.apache.org/job/PreCommit-HDFS-Build/3525//console This message is automatically generated.
        Hide
        kihwal Kihwal Lee added a comment -

        This patch allows logSync() to be invoked without any side effect (e.g. incorrectly incrementing the batched sync counter) even when there is no transactions logged by the calling thread. This allows calling logSync() outside the namespace lock, after returning from a journey through a call tree, at which point the caller is not sure about occurrence of transactions.

        Show
        kihwal Kihwal Lee added a comment - This patch allows logSync() to be invoked without any side effect (e.g. incorrectly incrementing the batched sync counter) even when there is no transactions logged by the calling thread. This allows calling logSync() outside the namespace lock, after returning from a journey through a call tree, at which point the caller is not sure about occurrence of transactions.

          People

          • Assignee:
            kihwal Kihwal Lee
            Reporter:
            kihwal Kihwal Lee
          • Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development