You are viewing a plain text version of this content. The canonical link for it is here.
Posted to oak-issues@jackrabbit.apache.org by "Mete Atamel (JIRA)" <ji...@apache.org> on 2012/11/08 11:41:12 UTC
[jira] [Created] (OAK-430) Incorrect read logic in
AbstractBlobStore
Mete Atamel created OAK-430:
-------------------------------
Summary: Incorrect read logic in AbstractBlobStore
Key: OAK-430
URL: https://issues.apache.org/jira/browse/OAK-430
Project: Jackrabbit Oak
Issue Type: Bug
Components: mk
Reporter: Mete Atamel
Priority: Minor
Attachments: diff.txt
AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
-Set block size to 80 and min block size to something less than 80 (eg. 48)
-Write a blob of length 81
-Try to read blob of length 81
At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Mete Atamel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mete Atamel updated OAK-430:
----------------------------
Attachment: diff.txt
Attaching a modified test that exhibits the bug.
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Mete Atamel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493251#comment-13493251 ]
Mete Atamel commented on OAK-430:
---------------------------------
It's a little weird that even 1 byte more than the block size requires re-reads but I'm fine with closing this.
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Assignee: Thomas Mueller
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493161#comment-13493161 ]
Thomas Mueller commented on OAK-430:
------------------------------------
Same as InputStream.read() and MicroKernel.read(..), the method readBlob(..) method returns the length actually read. In this case it only reads 80 bytes (the stored binary), and returns 80. So I would say it is not a bug, even thought it's not the most optimal solution (the client has to call the read() method again).
Is it OK if I close the bug for now? But I'm for changing the logic if turns out to be a performance problem.
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Assignee: Thomas Mueller
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Michael Dürig (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13493116#comment-13493116 ]
Michael Dürig commented on OAK-430:
-----------------------------------
Thanks for the test case. I added it in revision 1407011 but commented it out until this is fixed.
[~tmueller], could you have a look?
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Thomas Mueller (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Thomas Mueller reassigned OAK-430:
----------------------------------
Assignee: Thomas Mueller
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Assignee: Thomas Mueller
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (OAK-430) Incorrect read logic in
AbstractBlobStore
Posted by "Mete Atamel (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/OAK-430?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mete Atamel resolved OAK-430.
-----------------------------
Resolution: Not A Problem
It's technically not a bug, so closing for now. We can revisit if it turns out to be a performance problem.
> Incorrect read logic in AbstractBlobStore
> -----------------------------------------
>
> Key: OAK-430
> URL: https://issues.apache.org/jira/browse/OAK-430
> Project: Jackrabbit Oak
> Issue Type: Bug
> Components: mk
> Reporter: Mete Atamel
> Assignee: Thomas Mueller
> Priority: Minor
> Attachments: diff.txt
>
>
> AbstractBlobStore has incorrect read logic that manifests itself in this scenario:
> -Set block size to 80 and min block size to something less than 80 (eg. 48)
> -Write a blob of length 81
> -Try to read blob of length 81
> At this point, you get a blob of length 81 but the last byte in the array is zero (i.e. the last byte is not read correctly). I think this is because in blob write, first 80 bytes are written as a block and then the last byte is inlined since it's less than 48. This is all fine but while reading the blob, after reading the first 80 bytes from the block, 1 byte is forgotten.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira