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

Erik Krogen commented on HDFS-13607:
------------------------------------

Hey [~csun], thanks a lot for the review and my apologies for my lateness in 
responding.
# Sure, seems like a good improvement for readability. I rearranged a bit to 
make this clear.
# You are right that it is not used for any part of the core logic, but I think 
its presence is important to differentiate between two very different 
situations: (a) you request transactions which the cache has never seen 
(anomalous behavior on SbNN, or the JN was recently restarted and doesn't have 
this info in cache), (b) you request transactions which the cache has seen but 
then removed (so you probably need to increase the size of your cache). This 
knowledge is useful for an operator to know what to do about this type of 
CacheMissException.
# I'm not sure what you mean. If there are multiple layout versions present in 
the range of requested transactions, only transactions from the first layout 
version are returned. That's what the last line in the while-condition is for. 
Am I missing anything?
{code}
      // Stop when maximum transactions reached...
      while ((txnCount < maxTxns) &&
          // ... or there are no more entries ...
          (incrBuffIter.hasNext() || prevBuf != null) &&
          // ... or the next entry is a different layout version
          (getLayoutVersionForTxnId(prevTxn) == layoutVersion)) {
{code}
# Good call, I have consolidated to use {{txn}} throughout.
# Great catch, thanks. Fixed.
# I can't think of any possible scenario that could cause this, I agree with 
you that an {{assert}} would be more appropriate. Fixed.
# Yes, it is used by the tests in Part 4 (HDFS-13610). FYI all of the other 
parts already have their patches available and will apply correctly as long as 
you do them in order.

Attaching v002 patch with described changes.

> [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