You are viewing a plain text version of this content. The canonical link for it is here.
Posted to common-dev@hadoop.apache.org by "Konstantin Shvachko (JIRA)" <ji...@apache.org> on 2007/11/06 02:54:50 UTC
[jira] Created: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Non-interleaved checksums would optimize block transfers.
---------------------------------------------------------
Key: HADOOP-2154
URL: https://issues.apache.org/jira/browse/HADOOP-2154
Project: Hadoop
Issue Type: Improvement
Components: dfs
Affects Versions: 0.14.0
Reporter: Konstantin Shvachko
Fix For: 0.16.0
Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Assigned: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Rajagopal Natarajan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Rajagopal Natarajan reassigned HADOOP-2154:
-------------------------------------------
Assignee: Rajagopal Natarajan
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "eric baldeschwieler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546587 ]
eric baldeschwieler commented on HADOOP-2154:
---------------------------------------------
+1
We should not be doing these copies and interleaves if we can avoid them.
A lot of change here, but if we could move to a protocol where the client requests a buffer of bytes, rather than just pushing bytes, we could start the response with a CRCs list, followed by the bytes. This would require less RAM on the client side (I think).
Can we just memory map the block and then copy the requested chunk it directly to the socket or use other tricks to reduce copies further? (I'm NIO naive)
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Rajagopal Natarajan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545343 ]
Rajagopal Natarajan commented on HADOOP-2154:
---------------------------------------------
Before I start writing the code, I just have a query about this improvement. As I could see, maxbytes per checksum is typically 512 bytes by default. By default, block size is 67108864 bytes. This means that if the chunks would be written to sockets directly (as opposed to accumulating chunks and writing out once a full block is ready) with its checksum, we are decreasing the data:header ratio by a big factor, isn't it? Wouldn't this be inefficient? Or am I missing something?
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546864 ]
Raghu Angadi commented on HADOOP-2154:
--------------------------------------
Also "the original data (not partitioned into chunks)" does not mean full 128MB right? It is upto something like 64kB or what ever the io buffersize is...
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Rajagopal Natarajan (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546990 ]
Rajagopal Natarajan commented on HADOOP-2154:
---------------------------------------------
@Konstantin
Apologies. I had misunderstood your proposal, that I thought it is to avoid the use of backupstream and write each chunk-crc pair to socket directly instead of buffering. Now I understand what you meant.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (HADOOP-2154) Non-interleaved
checksums would optimize block transfers.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546864 ]
rangadi edited comment on HADOOP-2154 at 11/29/07 12:08 PM:
-----------------------------------------------------------------
Also "the original data (not partitioned into chunks)" does not mean full 128MB right? It is upto something like 64kB or what ever the io buffersize is...
Edit: This is what I mean by 2nd option in 2nd comment above.
was (Author: rangadi):
Also "the original data (not partitioned into chunks)" does not mean full 128MB right? It is upto something like 64kB or what ever the io buffersize is...
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "eric baldeschwieler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546800 ]
eric baldeschwieler commented on HADOOP-2154:
---------------------------------------------
Still +1, but apologies. I was thinking about the read case when I wrote the comment, I think what raghu stated makes more sense without my additions.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Doug Cutting (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546856 ]
Doug Cutting commented on HADOOP-2154:
--------------------------------------
I think you meant:
| the original data (not partitioned into chunks) | *crcs* for for the original data |
I.e., there will be a crc for each chunk in the original data, but the original data will not be broken into chunks. Is that right?
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546850 ]
Konstantin Shvachko commented on HADOOP-2154:
---------------------------------------------
Rajagopal, I do not see how the data:header ratio is decreasing here.
This issue is mainly about removing the interleaving buffer layout. Namely, now we partition the original data into chunks,
calculate crc for each chunk and create the following buffer, which subsequently is transferred to a data-node:
| data chunk 1 | crc for data chunk 1 | data chunk 2 | crc for data chunk 2 | ... | data chunk n | crc for data chunk n |
I propose to change it [back] to
| the original data (+not+ partitioned into chunks) | crc for for the original data |
If you add a header before each data and crc chunk then in current approach you will have 2*n headers, while in the proposed
approach there will be only 2. So the data:header ratio will increase: (|data| + |crc|) / 2n < (|data| + |crc|) / 2
This should let us get rid of that extra buffer that is used to collect all the interleaved pieces together.
And thus the issue is not about "writing the chunks to the socket directly", but rather about removing chunks all together.
Imo, this is related to both reads and writes. May be reads and writes should even share this code.
Removing other redundant buffers is a part of a different issue.
Eric, why do you think transferring crc before the data would require less RAM on the client?
If it does then it definitely makes sense to send crcs before the data bytes.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546909 ]
Konstantin Shvachko commented on HADOOP-2154:
---------------------------------------------
Yes on both comments.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Issue Comment Edited: (HADOOP-2154) Non-interleaved
checksums would optimize block transfers.
Posted by "Konstantin Shvachko (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546850 ]
shv edited comment on HADOOP-2154 at 11/29/07 1:36 PM:
-----------------------------------------------------------------------
Rajagopal, I do not see how the data:header ratio is decreasing here.
This issue is mainly about removing the interleaving buffer layout. Namely, now we partition the original data into chunks,
calculate crc for each chunk and create the following buffer, which subsequently is transferred to a data-node:
| data chunk 1 | crc for data chunk 1 | data chunk 2 | crc for data chunk 2 | ... | data chunk n | crc for data chunk n |
I propose to change it [back] to
| the original data (+not+ partitioned into chunks) | crcs for the original data |
If you add a header before each data and crc chunk then in current approach you will have 2*n headers, while in the proposed
approach there will be only 2. So the data:header ratio will increase: (|data| + |crc|) / 2n < (|data| + |crc|) / 2
This should let us get rid of that extra buffer that is used to collect all the interleaved pieces together.
And thus the issue is not about "writing the chunks to the socket directly", but rather about removing chunks all together.
Imo, this is related to both reads and writes. May be reads and writes should even share this code.
Removing other redundant buffers is a part of a different issue.
Eric, why do you think transferring crc before the data would require less RAM on the client?
If it does then it definitely makes sense to send crcs before the data bytes.
was (Author: shv):
Rajagopal, I do not see how the data:header ratio is decreasing here.
This issue is mainly about removing the interleaving buffer layout. Namely, now we partition the original data into chunks,
calculate crc for each chunk and create the following buffer, which subsequently is transferred to a data-node:
| data chunk 1 | crc for data chunk 1 | data chunk 2 | crc for data chunk 2 | ... | data chunk n | crc for data chunk n |
I propose to change it [back] to
| the original data (+not+ partitioned into chunks) | crc for for the original data |
If you add a header before each data and crc chunk then in current approach you will have 2*n headers, while in the proposed
approach there will be only 2. So the data:header ratio will increase: (|data| + |crc|) / 2n < (|data| + |crc|) / 2
This should let us get rid of that extra buffer that is used to collect all the interleaved pieces together.
And thus the issue is not about "writing the chunks to the socket directly", but rather about removing chunks all together.
Imo, this is related to both reads and writes. May be reads and writes should even share this code.
Removing other redundant buffers is a part of a different issue.
Eric, why do you think transferring crc before the data would require less RAM on the client?
If it does then it definitely makes sense to send crcs before the data bytes.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "Raghu Angadi (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12545517 ]
Raghu Angadi commented on HADOOP-2154:
--------------------------------------
In my initial implementation of HADOOP-1134, I did not keep buffers between socket and datanode (reader and writer). Looks like this jira proposes that. Note that I had to put the buffers back since there was a regression on DFSIO benchmarks and sort. Pretty much none of our benchmarks is cpu intensive on Datanodes.
If we want to get rid of extra buffer copies, I would either look in to one these two :
# reorganize the while loop so that there is one extra copy (from disk to user buffer) and not two. i.e. large user buffer directly written to socket (in the case of block read).
# Remove both copies by extending the protocol to allow one DATA_CHUNK to allow multiple CHECKSUM chunks. e.g. one DATA_CHUNK would contain 64k worth of block data directly to user buffer and 65k*4/512 checksum bytes at the end. So that Datanode directly reads in to large user buffer and that buffer is written to socket (basically bringing buffer handling back to pre HADOOP-1134).
# Using multiple sockets is another option but I am not a fan of it.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (HADOOP-2154) Non-interleaved checksums would
optimize block transfers.
Posted by "eric baldeschwieler (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/HADOOP-2154?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12546914 ]
eric baldeschwieler commented on HADOOP-2154:
---------------------------------------------
I'm not sure order actually matters. I can think of arguments for either.
> Non-interleaved checksums would optimize block transfers.
> ---------------------------------------------------------
>
> Key: HADOOP-2154
> URL: https://issues.apache.org/jira/browse/HADOOP-2154
> Project: Hadoop
> Issue Type: Improvement
> Components: dfs
> Affects Versions: 0.14.0
> Reporter: Konstantin Shvachko
> Assignee: Rajagopal Natarajan
> Fix For: 0.16.0
>
>
> Currently when a block is transfered to a data-node the client interleaves data chunks with the respective checksums.
> This requires creating an extra copy of the original data in a new buffer interleaved with the crcs.
> We can avoid extra copying if the data and the crc are fed to the socket one after another.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.