1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Port of commit: 1ff23d0cd70d576a0f4e512ce332cff348591d36

from server/columnstore_cache.

Commit message:

Fixed bug in free locks that caused rows in cache to not be properly flushed

Fixed by doing adding external_lock(F_UNLCK) in free_locks.
I also moved unlock of cache_handler to be after changing lock type of
cached tables to ensure that no one can use cached table while this is
happening (as cache table is locked with write lock).
I also fixed a wrong mutex order bug in ha_cache::flush_insert_cache()

Other things:
- Addded share::cached_rows to track inserted rows. This is only used
  for asserts to check the number of rows in the cache.
- Fixed wrong mysql_file_chsize() in case of repair
This commit is contained in:
Gagan Goel
2020-08-11 18:44:08 -04:00
parent 4afcba9520
commit 709290cc3d
2 changed files with 60 additions and 14 deletions

View File

@ -248,8 +248,10 @@ class ha_mcs_cache_share
const char *name;
uint open_count;
public:
ulonglong cached_rows;
THR_LOCK org_lock;
friend ha_mcs_cache_share *find_cache_share(const char *name);
friend ha_mcs_cache_share *find_cache_share(const char *name,
ulonglong cached_rows);
void close();
};
@ -259,7 +261,7 @@ class ha_mcs_cache :public ha_mcs
{
typedef ha_mcs parent;
int original_lock_type;
bool insert_command;
bool insert_command, cache_locked;
public:
uint lock_counter;