Closed bseibel closed 10 years ago
Thanks for the submission, I'll have a look ASAP.
Just had a look.
It is right we miss to remove hints for compacted files, but I'd hold on this pull request because I think there are other small holes in the "post-compaction" behaviour, like when iterating over a completely compacted away data file, and I'd like to address those ones too: what do you think? Are you ok with that?
Yeah for sure, I suspected as much since it didn't seem like this case should be possible.
-brs
On Dec 20, 2013, at 3:33 PM, Sergio Bossa notifications@github.com wrote:
Just had a look.
It is right we miss to remove hints for compacted files, but I'd hold on this pull request because I think there are other small holes in the "post-compaction" behaviour, like when iterating over a completely compacted away data file, and I'd like to address those ones too: what do you think? Are you ok with that?
— Reply to this email directly or view it on GitHubhttps://github.com/sbtourist/Journal.IO/pull/52#issuecomment-31039516 .
Hey @bseibel, I pushed some changes in the "issue52" branch: basically, I removed the "global" pause/resume, as it should be ok to only pause at single file compaction time, and used the already existent removeDataFile method to clear hints.
What do you think? Do you mind having a quick review?
I had to force-push a few times, so just refer to the "issue52" branch.
Also fixed iteration over compacted data file.
Aha! I completely missed that removeDataFile cleans up hints; One goes blind after trying to figure out new code for awhile :). I'll rerun a few of my tests as soon as I get a free moment to see if it takes care of my use case too.
Cool, thanks much.
I'll be releasing 1.4.2 later today, just not sure if to include this issue...
Haven't dug into why yet but about 1 in 40'ish runs of the Concurrent tests will cause testConcurrentCompactionDuringWriteAndRead to fail at assertEquals(iterations - deletions, locations);
with locations
being between 1-5 shy from the expected 900.
That's something I should have fixed in: https://github.com/sbtourist/Journal.IO/commit/991c1dd9d9841fae567941eead463d803f80095c
Do you have that commit?
Yeah, this was out of your fork/issue52 branch.
@bseibel, that should be fixed now. I also improved tests a bit, hopefully no more bugs :)
Looks good now! Thanks @sbtourist !
Thanks!
I had been seeing some random IllegalStateExceptions from
hasRecordHeader
. I was also able to gettestConcurrentCompactionDuringWriteAndRead
to fail the odd time after hammering on it repeatedly.I'm not sure if there may be another underlying cause based on my limited understanding of the internals but it seems there are occasions where the hints map would contain old positions added from signalBatch after a compaction. This patch just ensures that only the hint added by compaction is present for the datafile just compacted.