Merge lp:~akopytov/percona-server/bug1248505 into lp:percona-server/5.6

Proposed by Alexey Kopytov
Status: Merged
Approved by: Sergei Glushchenko
Approved revision: no longer in the source branch.
Merged at revision: 494
Proposed branch: lp:~akopytov/percona-server/bug1248505
Merge into: lp:percona-server/5.6
Diff against target: 127 lines (+58/-45)
1 file modified
Percona-Server/storage/innobase/handler/ha_innodb.cc (+58/-45)
To merge this branch: bzr merge lp:~akopytov/percona-server/bug1248505
Reviewer Review Type Date Requested Status
Sergei Glushchenko (community) g2 Approve
Review via email: mp+194305@code.launchpad.net

Description of the change

    Bug #1248505: innodb_log_checksum_algorithm has effect only when set
                  dynamically

    Fixed innodb_init() so that log_checksum_algorithm_ptr is properly
    updated on startup.

http://jenkins.percona.com/view/PS%205.6/job/percona-server-5.6-param/405/

To post a comment you must log in.
Revision history for this message
Sergei Glushchenko (sergei.glushchenko) wrote :

Approve

review: Approve (g2)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-10-23 08:48:28 +0000
+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-11-07 10:26:04 +0000
@@ -2409,6 +2409,62 @@
2409 return(trx->state != TRX_STATE_NOT_STARTED);2409 return(trx->state != TRX_STATE_NOT_STARTED);
2410}2410}
24112411
2412/****************************************************************//**
2413Update log_checksum_algorithm_ptr with a pointer to the function corresponding
2414to a given checksum algorithm. */
2415static
2416void
2417innodb_log_checksum_func_update(
2418/*============================*/
2419 ulint algorithm) /*!< in: algorithm */
2420{
2421 switch (algorithm) {
2422 case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
2423 case SRV_CHECKSUM_ALGORITHM_INNODB:
2424 log_checksum_algorithm_ptr=log_block_calc_checksum_innodb;
2425 break;
2426 case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
2427 case SRV_CHECKSUM_ALGORITHM_CRC32:
2428 log_checksum_algorithm_ptr=log_block_calc_checksum_crc32;
2429 break;
2430 case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
2431 case SRV_CHECKSUM_ALGORITHM_NONE:
2432 log_checksum_algorithm_ptr=log_block_calc_checksum_none;
2433 break;
2434 default:
2435 ut_a(0);
2436 }
2437}
2438
2439/****************************************************************//**
2440On update hook for the innodb_log_checksum_algorithm variable. */
2441static
2442void
2443innodb_log_checksum_algorithm_update(
2444/*=================================*/
2445 THD* thd, /*!< in: thread handle */
2446 struct st_mysql_sys_var* var, /*!< in: pointer to
2447 system variable */
2448 void* var_ptr,/*!< out: where the
2449 formal string goes */
2450 const void* save) /*!< in: immediate result
2451 from check function */
2452{
2453 srv_checksum_algorithm_t algorithm;
2454
2455 algorithm = (srv_checksum_algorithm_t)
2456 (*static_cast<const ulong*>(save));
2457
2458 /* Make sure we are the only log user */
2459 mutex_enter(&log_sys->mutex);
2460
2461 innodb_log_checksum_func_update(algorithm);
2462
2463 srv_log_checksum_algorithm = algorithm;
2464
2465 mutex_exit(&log_sys->mutex);
2466}
2467
2412/*********************************************************************//**2468/*********************************************************************//**
2413Copy table flags from MySQL's HA_CREATE_INFO into an InnoDB table object.2469Copy table flags from MySQL's HA_CREATE_INFO into an InnoDB table object.
2414Those flags are stored in .frm file and end up in the MySQL table object,2470Those flags are stored in .frm file and end up in the MySQL table object,
@@ -3487,6 +3543,8 @@
3487 srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE;3543 srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE;
3488 }3544 }
34893545
3546 innodb_log_checksum_func_update(srv_log_checksum_algorithm);
3547
3490#ifdef HAVE_LARGE_PAGES3548#ifdef HAVE_LARGE_PAGES
3491 if ((os_use_large_pages = (ibool) my_use_large_pages)) {3549 if ((os_use_large_pages = (ibool) my_use_large_pages)) {
3492 os_large_page_size = (ulint) opt_large_page_size;3550 os_large_page_size = (ulint) opt_large_page_size;
@@ -15759,51 +15817,6 @@
15759}15817}
1576015818
15761/****************************************************************//**15819/****************************************************************//**
15762Update log_checksum_algorithm_ptr with a pointer to the function corresponding
15763to a given checksum algorithm. */
15764static
15765void
15766innodb_log_checksum_algorithm_update(
15767/*=================================*/
15768 THD* thd, /*!< in: thread handle */
15769 struct st_mysql_sys_var* var, /*!< in: pointer to
15770 system variable */
15771 void* var_ptr,/*!< out: where the
15772 formal string goes */
15773 const void* save) /*!< in: immediate result
15774 from check function */
15775{
15776 srv_checksum_algorithm_t algorithm;
15777
15778 algorithm = (srv_checksum_algorithm_t)
15779 (*static_cast<const ulong*>(save));
15780
15781 /* Make sure we are the only log user */
15782 mutex_enter(&log_sys->mutex);
15783
15784 switch (algorithm) {
15785 case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
15786 case SRV_CHECKSUM_ALGORITHM_INNODB:
15787 log_checksum_algorithm_ptr=log_block_calc_checksum_innodb;
15788 break;
15789 case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
15790 case SRV_CHECKSUM_ALGORITHM_CRC32:
15791 log_checksum_algorithm_ptr=log_block_calc_checksum_crc32;
15792 break;
15793 case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
15794 case SRV_CHECKSUM_ALGORITHM_NONE:
15795 log_checksum_algorithm_ptr=log_block_calc_checksum_none;
15796 break;
15797 default:
15798 ut_a(0);
15799 }
15800
15801 srv_log_checksum_algorithm = algorithm;
15802
15803 mutex_exit(&log_sys->mutex);
15804}
15805
15806/****************************************************************//**
15807Parse and enable InnoDB monitor counters during server startup.15820Parse and enable InnoDB monitor counters during server startup.
15808User can list the monitor counters/groups to be enable by specifying15821User can list the monitor counters/groups to be enable by specifying
15809"loose-innodb_monitor_enable=monitor_name1;monitor_name2..."15822"loose-innodb_monitor_enable=monitor_name1;monitor_name2..."

Subscribers

People subscribed via source and target branches