Hi!
>>>>> "Kuts" == Kuts Alexey <krunt@stripped> writes:
Kuts> Hi,
Kuts> I am just learning the inner working of myisam key cache
Kuts> and found some inconsistency in mf_keycache.c
Kuts> here is this place and my suggested patch:
Kuts> --- mysys/mf_keycache.c 2011-09-07 10:08:09 +0000
Kuts> +++ mysys/mf_keycache.c 2013-03-06 07:53:02 +0000
Kuts> @@ -3404,7 +3404,7 @@
Kuts> return;
Kuts> /* Error blocks are not put into the LRU ring. */
Kuts> - if (!(block->status & BLOCK_ERROR))
Kuts> + if (block->status & BLOCK_ERROR)
Kuts> {
Kuts> /* Here the block must be in the LRU ring. Unlink it again. */
Kuts> DBUG_ASSERT(block->next_used && block->prev_used &&
Kuts> I don't know, is there really a bug, that erroneous blocks are remained in
> LRU-ring.
I was looking at the code and the original code kind of makes sence.
According to the comment, error blocks are not put the LRU ring,
so they should not be unlinked (as it's done inside the if).
Are you sure that error blocks are in the LRU ring?
How did you conclude that?
I looked at the code in unreg_request() just before the above code
and it clearly doesn't link blocks with BLOCK_ERROR into the LRU ring.
Regards,
Monty
Creator of MariaDB and MySQL