[MDEV-3063] LP:1021131 - dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 Created: 2012-07-28 Updated: 2012-10-04 Resolved: 2012-10-04 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Bug | ||
| Reporter: | Hickey | Assignee: | Oleksandr Byelkin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | Launchpad | ||
| Attachments: |
|
| Description |
|
As we know, query_cache overhead for LOCK can only be avoided when start-up mysql with query_cache_type is 0. That's what Percona contributed: http://www.percona.com/doc/percona-server/5.5/performance/query_cache_enhance.html?id=percona-server:features:query_cache_enhance#disabling_the_cache_completely That's a nice work. However, if we want the query cache back, the mysqld must be restarted with query_cache_type=1. That's the problem, and some customers faced the scenarios. I looked into the code, and found it might be resolved without the limitation of restarted mysqld. If we call is_disabled with a traced query_cache_type and combined with current setting query_cache_type, it's Okay to judge whether we could get the same result as old is_disabled function in Query_cache class. Detail info could refer to qc.patch, which is based on Percona-5.5.18 |
| Comments |
| Comment by Hickey [ 2012-07-05 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Hickey [ 2012-07-05 ] |
|
qc.patch |
| Comment by Hickey [ 2012-07-20 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Hickey [ 2012-07-20 ] |
|
please ignore the first one. |
| Comment by Oleksandr Byelkin [ 2012-07-31 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Oleksandr Byelkin [ 2012-07-31 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 --echo New query cache switching OFF mechanism test |
| Comment by Hickey [ 2012-08-08 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 What I mean is not the dynamic switch query cache from OFF to ON, but is to talking the overhead lock from OFF to ON. Let me demo it with an simple example: 1. Run the simple test and we could see the injected code triggered. $./mtr - main.qc [ fail ] Found warnings/errors in server log file! 2. Test case is:
create table t1 (a int not null); update t1 set a=a+1; drop table t1; 3. The injected code for test is: DEBUG_SYNC(thd, "wait_in_query_cache_invalidate2"); if (query_cache_size > 0) 4. The result patched for Percona is: worker[1] Using MTR_BUILD_THREAD 300, with reserved ports 13000..13009 |
| Comment by Hickey [ 2012-08-08 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Oleksandr Byelkin [ 2012-08-31 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Hickey [ 2012-09-04 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 |
| Comment by Rasmus Johansson (Inactive) [ 2012-09-16 ] |
|
Re: dynamic setting query_cache_type but keeping the benefit of keeping away of overhead LOCK if query cache type is 0 I noticed that there is a tracking variable used: m_requests_in_progress which is to make sure that disabling/enabling is not done while queries are in-flight within the query cache critical section. I see that the enabling the a disabled query cache can fail only when a) query cache disabling is in progress or |
| Comment by Rasmus Johansson (Inactive) [ 2012-09-25 ] |
|
Launchpad bug id: 1021131 |