Commit 18560ccd authored by unknown's avatar unknown

Fixed pagecache unittest


storage/maria/ma_pagecache.c:
  - remove_reader() call is removed from unlock/unpin operations
    which uses direct link (because find_block() was not called)
  - patch which broke pagecache unittest is reverted
parent b92a1bd4
...@@ -2689,7 +2689,6 @@ void pagecache_unlock_by_link(PAGECACHE *pagecache, ...@@ -2689,7 +2689,6 @@ void pagecache_unlock_by_link(PAGECACHE *pagecache,
if (make_lock_and_pin(pagecache, block, lock, pin)) if (make_lock_and_pin(pagecache, block, lock, pin))
DBUG_ASSERT(0); /* should not happend */ DBUG_ASSERT(0); /* should not happend */
remove_reader(block);
/* /*
Link the block into the LRU chain if it's the last submitted request Link the block into the LRU chain if it's the last submitted request
for the block and block will not be pinned. for the block and block will not be pinned.
...@@ -2754,7 +2753,6 @@ void pagecache_unpin_by_link(PAGECACHE *pagecache, ...@@ -2754,7 +2753,6 @@ void pagecache_unpin_by_link(PAGECACHE *pagecache,
PAGECACHE_UNPIN)) PAGECACHE_UNPIN))
DBUG_ASSERT(0); /* should not happend */ DBUG_ASSERT(0); /* should not happend */
remove_reader(block);
/* /*
Link the block into the LRU chain if it's the last submitted request Link the block into the LRU chain if it's the last submitted request
for the block and block will not be pinned. for the block and block will not be pinned.
...@@ -2891,16 +2889,14 @@ byte *pagecache_valid_read(PAGECACHE *pagecache, ...@@ -2891,16 +2889,14 @@ byte *pagecache_valid_read(PAGECACHE *pagecache,
#endif #endif
} }
remove_reader(block);
/* /*
Link the block into the LRU chain if it's the last submitted request Link the block into the LRU chain if it's the last submitted request
for the block and block will not be pinned. for the block and block will not be pinned.
See NOTE for pagecache_unlock about registering requests. See NOTE for pagecache_unlock about registering requests.
*/ */
if (pin == PAGECACHE_PIN_LEFT_UNPINNED || pin == PAGECACHE_UNPIN) if (pin == PAGECACHE_PIN_LEFT_UNPINNED || pin == PAGECACHE_UNPIN)
{
remove_reader(block);
unreg_request(pagecache, block, 1); unreg_request(pagecache, block, 1);
}
else else
*link= (PAGECACHE_PAGE_LINK)block; *link= (PAGECACHE_PAGE_LINK)block;
...@@ -3286,20 +3282,14 @@ my_bool pagecache_write_part(PAGECACHE *pagecache, ...@@ -3286,20 +3282,14 @@ my_bool pagecache_write_part(PAGECACHE *pagecache,
DBUG_ASSERT(0); DBUG_ASSERT(0);
} }
/* See NOTE for pagecache_unlock about registering requests. */
if (pin == PAGECACHE_PIN_LEFT_UNPINNED || pin == PAGECACHE_UNPIN)
{
/* Unregister the request */ /* Unregister the request */
DBUG_ASSERT(block->hash_link->requests > 0); DBUG_ASSERT(block->hash_link->requests > 0);
block->hash_link->requests--; block->hash_link->requests--;
/* See NOTE for pagecache_unlock about registering requests. */
if (pin == PAGECACHE_PIN_LEFT_UNPINNED || pin == PAGECACHE_UNPIN)
unreg_request(pagecache, block, 1); unreg_request(pagecache, block, 1);
}
else else
{
if (pin == PAGECACHE_PIN_LEFT_PINNED)
block->hash_link->requests--;
*link= (PAGECACHE_PAGE_LINK)block; *link= (PAGECACHE_PAGE_LINK)block;
}
if (block->status & PCBLOCK_ERROR) if (block->status & PCBLOCK_ERROR)
error= 1; error= 1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment