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

Haohui Mai commented on HDFS-7748:
----------------------------------

{code}
+// A flags structure which lets us send various
+// information back to the client
+enum Flags {
+  // ECN - Explicit Congestion Notification
+  // This tells the client that we have congestion
+  // in the data pipeline. This will allow ECN aware
+  // clients to back-off gracefully.
+
+  ECN_DISABLED      = 0; // ECN information is disabled in configuration
+  ECN_SUPPORTED     = 1; // We have no congestion in the data pipeline
+  ECN_SUPPORTED2    = 2; // Same thing as above, please see RFC-3168
+  ECN_CONGESTED     = 3; // We are experiencing a congestion in the data 
pipeline
+}
+
{code}

There might be an issue when listing these numbers as an enum -- protobuf will 
create an Enum class, will it hinder forward compatibility?

{code}
+  private final static boolean DFS_ECN_ENABLED;
+      DFS_ECN_ENABLED ? Flags.ECN_SUPPORTED_VALUE : Flags.ECN_DISABLED_VALUE);

-  public PipelineAck(long seqno, int[] replies,
-                     long downstreamAckTimeNanos) {
-    ArrayList<Integer> replyList = Lists.newArrayList();
-    for (int r : replies) {
-      replyList.add(r);
-    }
{code}

I start thinking that it might be better to combine Status and ECN flags 
internally --- conceptually they are both parts of the header flags, it makes 
sense to always combine them together and pass them along, but to put them into 
different fields in the protobuf message. 




> Separate ECN flags from the Status in the DataTransferPipelineAck
> -----------------------------------------------------------------
>
>                 Key: HDFS-7748
>                 URL: https://issues.apache.org/jira/browse/HDFS-7748
>             Project: Hadoop HDFS
>          Issue Type: Bug
>            Reporter: Haohui Mai
>            Assignee: Anu Engineer
>            Priority: Blocker
>         Attachments: hdfs-7748.001.patch, hdfs-7748.002.patch, 
> hdfs-7748.003.patch
>
>
> Prior to the discussions on HDFS-7270, the old clients might fail to talk to 
> the newer server when ECN is turned on. This jira proposes to separate the 
> ECN flags in a separate protobuf field to make the ack compatible on both 
> versions.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to