Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-21721

FSHLog : reduce write#syncs() times

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.3.1, 2.1.1, 2.2.3
    • 3.0.0-alpha-1, 2.3.1, 1.7.0, 2.4.0, 2.2.6
    • None
    • None
    • Reviewed

    Description

      the number of write#syncs can be reduced by updating the highestUnsyncedSequence:
      before write#sync(), get the current highestUnsyncedSequence
      after write#sync, highestSyncedSequence=highestUnsyncedSequence

       

      FSHLog.java
      // Some comments here
      public void run()
      {
          long currentSequence;
            while (!isInterrupted()) {
              int syncCount = 0;
      
              try {
                while (true) {
                  ...
                try {
                  Trace.addTimelineAnnotation("syncing writer");
                  long unSyncedFlushSeq = highestUnsyncedSequence;
                  writer.sync();
                  Trace.addTimelineAnnotation("writer synced");
                  if( unSyncedFlushSeq > currentSequence ) currentSequence = unSyncedFlushSeq;
                  currentSequence = updateHighestSyncedSequence(currentSequence);
                } catch (IOException e) {
                  LOG.error("Error syncing, request close of WAL", e);
                  lastException = e;
                } catch (Exception e) {
                 ...
          }
      }
      

      Add code
       long unSyncedFlushSeq = highestUnsyncedSequence;
      if( unSyncedFlushSeq > currentSequence ) currentSequence = unSyncedFlushSeq;

      Attachments

        Activity

          People

            Bo Cui Bo Cui
            Bo Cui Bo Cui
            Votes:
            0 Vote for this issue
            Watchers:
            12 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: