Closed GoogleCodeExporter closed 9 years ago
the file already had data and you are appending more? could you provide a short
test case please. thx
Original comment by yuriastrakhan
on 23 Feb 2012 at 7:47
Right - the file already had data, and I'm appending more. It appears that the
last block has only 40 bytes in it, while the method CalcMaxItemsInBlock was
called with a MaxItemsByteSize of 50 and a minItemByteSize of 5. This results
in a MaxItemsInBlock of -1 (40 - 50) / 5 + 1 = -1.
I'm assuming each block must begin with a write that uses the MaxItemsByteSize,
somehow a block is being written to that is shorter than this MaxItemsByteSize.
It is quite reporoducable, but my test case uses a several gb file. I will see
if I can reproduce with a simple test case. Let me know if you can understand
from the details I've sent.
Original comment by kar...@gmail.com
on 23 Feb 2012 at 7:52
I kinda understand where the problem is, but i still could use a unit test of
some sorts so that i can reliably test it and make sure any similar bugs are
fixed. Could you create a simple one like that? It shouldn't require a
pre-existing data file.
Original comment by yuriastrakhan
on 23 Feb 2012 at 8:30
Changing CalcMaxItemsInBlock method to simply be blockSize / _minItemByteSize
appears to solve the issue. I did several tests that showed the first record
written to a block can often be much less than the maxByte size, which appears
to be causing this issue.
Original comment by kar...@gmail.com
on 23 Feb 2012 at 9:05
I have changed some writing code, hard to tell if I have fixed your issues.
Can provide a simple unit test for this? For examples, see WritableFeedTests.cs
Original comment by yuriastrakhan
on 1 Mar 2012 at 8:02
Please see the attached unit test which causes this exception.
If you modify CalcMaxItemsInBlock to "return 1 + (blockSize - _maxItemByteSize)
/ _minItemByteSize;" within BinCompressedSeriesFile.cs, the tests pass.
Original comment by kar...@gmail.com
on 2 Mar 2012 at 8:25
Attachments:
fixed, thanks!
Original comment by yuriastrakhan
on 2 Mar 2012 at 10:18
Original issue reported on code.google.com by
kar...@gmail.com
on 23 Feb 2012 at 7:42