Return-Path: X-Original-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Delivered-To: apmail-hadoop-hdfs-issues-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 096EF104C4 for ; Sat, 28 Feb 2015 14:25:07 +0000 (UTC) Received: (qmail 12855 invoked by uid 500); 28 Feb 2015 14:25:06 -0000 Delivered-To: apmail-hadoop-hdfs-issues-archive@hadoop.apache.org Received: (qmail 12796 invoked by uid 500); 28 Feb 2015 14:25:06 -0000 Mailing-List: contact hdfs-issues-help@hadoop.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hdfs-issues@hadoop.apache.org Delivered-To: mailing list hdfs-issues@hadoop.apache.org Received: (qmail 12783 invoked by uid 99); 28 Feb 2015 14:25:06 -0000 Received: from arcas.apache.org (HELO arcas.apache.org) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 28 Feb 2015 14:25:06 +0000 Date: Sat, 28 Feb 2015 14:25:06 +0000 (UTC) From: "Hudson (JIRA)" To: hdfs-issues@hadoop.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (HDFS-7308) DFSClient write packet size may > 64kB MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/HDFS-7308?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14341545#comment-14341545 ] Hudson commented on HDFS-7308: ------------------------------ FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #109 (See [https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/109/]) HDFS-7308. Change the packet chunk size computation in DFSOutputStream in order to enforce packet size <= 64kB. Contributed by Takuya Fukudome (szetszwo: rev a979f3b58fafebbd6118ec1f861cf3f62c59c9cb) * hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt * hadoop-hdfs-project/hadoop-hdfs/src/test/java/org/apache/hadoop/hdfs/TestDFSOutputStream.java * hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/DFSOutputStream.java > DFSClient write packet size may > 64kB > -------------------------------------- > > Key: HDFS-7308 > URL: https://issues.apache.org/jira/browse/HDFS-7308 > Project: Hadoop HDFS > Issue Type: Improvement > Components: hdfs-client > Reporter: Tsz Wo Nicholas Sze > Assignee: Takuya Fukudome > Priority: Minor > Fix For: 2.7.0 > > Attachments: HDFS-7308.1.patch, HDFS-7308.2.patch > > > In DFSOutputStream.computePacketChunkSize(..), > {code} > private void computePacketChunkSize(int psize, int csize) { > final int chunkSize = csize + getChecksumSize(); > chunksPerPacket = Math.max(psize/chunkSize, 1); > packetSize = chunkSize*chunksPerPacket; > if (DFSClient.LOG.isDebugEnabled()) { > ... > } > } > {code} > We have the following > || variables || usual values || > | psize | dfsClient.getConf().writePacketSize = 64kB | > | csize | bytesPerChecksum = 512B | > | getChecksumSize(), i.e. CRC size | 32B | > | chunkSize = csize + getChecksumSize() | 544B (not a power of two) | > | psize/chunkSize | 120.47 | > | chunksPerPacket = max(psize/chunkSize, 1) | 120 | > | packetSize = chunkSize*chunksPerPacket (not including header) | 65280B | > | PacketHeader.PKT_MAX_HEADER_LEN | 33B | > | actual packet size | 65280 + 33 = *65313* < 65536 = 64k | > It is fortunate that the usual packet size = 65313 < 64k although the calculation above does not guarantee it always happens (e.g. if PKT_MAX_HEADER_LEN=257, then actual packet size=65537 > 64k.) We should fix the computation in order to guarantee actual packet size < 64k. -- This message was sent by Atlassian JIRA (v6.3.4#6332)