[ 
https://issues.apache.org/jira/browse/HDFS-13607?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16491357#comment-16491357
 ] 

Chao Sun commented on HDFS-13607:
---------------------------------

Thanks [~xkrogen]. The patch looks really good. I just have a few minor 
comments:
 # could we move {{readLock}} and {{writeLock}} before all the fields they 
protect? this makes it easier to read.
 # is {{initialTxnId}} necessary? seems it is only used in generating cache 
miss exception.
 # inĀ {{retrieveEdits}}, in case the cache has two entries with different 
layout version, it may add both to the outputBuffers, but the {{txnCount}} is 
still set correctly. Not sure if this could be an issue.
# in some places we name transaction as {{tx}} (such as in {{startTx}}), while 
in other places we use {{txn}} (such as in {{startTxnId}}). Maybe unify them?
# seems {{storeEdits}} will log an error when the cache is initialized and 
{{highestTxnId = -1}}? because of:
{code}
if ((highestTxnId + 1) != startTx) {
  // Cache is out of sync; clear to avoid storing noncontiguous regions
  Journal.LOG.error(String.format("Edits cache is out of sync; " +
          "looked for next txn id at %d but got start txn id for " +
          "cache put request at %d", highestTxnId + 1, startTx));
}
{code}
# In {{getHeader}}:
{code}
    } else if (exception.get() == null) {
      throw new IOException("BUG/ERROR: Got null for header for version " +
          layoutVersion + " but no exception found");
{code}
Could this ever happen? maybe an assertion is enough?
# {{getRawDataForTests}} is unused, but I suppose it will be in one of the 
following patches?

> [Edit Tail Fast Path Pt 1] Enhance JournalNode with an in-memory cache of 
> recent edit transactions
> --------------------------------------------------------------------------------------------------
>
>                 Key: HDFS-13607
>                 URL: https://issues.apache.org/jira/browse/HDFS-13607
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: ha, journal-node
>            Reporter: Erik Krogen
>            Assignee: Erik Krogen
>            Priority: Major
>         Attachments: HDFS-13607-HDFS-12943.000.patch, 
> HDFS-13607-HDFS-12943.001.patch
>
>
> See HDFS-13150 for full design.
> This JIRA is to add the in-memory cache of recent edit transactions on the 
> JournalNode. This JIRA does not include accesses to this cache.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to