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

Vinayakumar B commented on HDFS-6513:
-------------------------------------

Hi [~dian.fu],

Thanks for the patch. Below are few comments on patch.

1. in the below code,
{code}+  public EditLogOutputStream startLogSegment(long txId, int 
layoutVersion) throws IOException {
+    Preconditions.checkState(isActiveWriter,
+        "must recover segments before starting a new one");
+    if (txId <= lastCommittedTxId) {
+      throw new IOException("Mirror Cluster at Region [" 
+          + regionId + "] is newer than the Primary Cluster.");
+    } else if (txId > lastCommittedTxId + 1 && !editLogSyncProcessed) {
+      editLogSyncProcessed = true;
+      long endTxId = syncLogsFrom(lastCommittedTxId + 1);
+      assert endTxId + 1 == txId;
+    }{code}

  a) put {{editLogSyncProcessed = true;}} after {{long endTxId = 
syncLogsFrom(lastCommittedTxId + 1);}}.
  b) use {{Preconditions}} instead of assert in {{assert endTxId + 1 == txId;}}

2. There are some trailing whitespaces at the beginning of the line. Please 
remove them

3. There are still some TODO items in MirrorJournalManager. Are you planning to 
work in these later?

> Add MirrorJournalManager to transfer edits from primary cluster to Mirror 
> cluster
> ---------------------------------------------------------------------------------
>
>                 Key: HDFS-6513
>                 URL: https://issues.apache.org/jira/browse/HDFS-6513
>             Project: Hadoop HDFS
>          Issue Type: Sub-task
>          Components: namenode
>            Reporter: Vinayakumar B
>            Assignee: Dian Fu
>         Attachments: HDFS-6513.patch
>
>
> There is a need of separate JournalManager implementation to transfer the 
> edits to mirror cluster in synchronous mode of data replication to mirror 
> cluster.
> This Jira targets the implementation of the MirrorJournalManager, which will 
> be used as another shared journal at the primary cluster's Active Namenode.



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to