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
1=== modified file 'Percona-Server/storage/innobase/handler/ha_innodb.cc'
2--- Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-10-23 08:48:28 +0000
3+++ Percona-Server/storage/innobase/handler/ha_innodb.cc 2013-11-07 10:26:04 +0000
4@@ -2409,6 +2409,62 @@
5 return(trx->state != TRX_STATE_NOT_STARTED);
6 }
7
8+/****************************************************************//**
9+Update log_checksum_algorithm_ptr with a pointer to the function corresponding
10+to a given checksum algorithm. */
11+static
12+void
13+innodb_log_checksum_func_update(
14+/*============================*/
15+ ulint algorithm) /*!< in: algorithm */
16+{
17+ switch (algorithm) {
18+ case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
19+ case SRV_CHECKSUM_ALGORITHM_INNODB:
20+ log_checksum_algorithm_ptr=log_block_calc_checksum_innodb;
21+ break;
22+ case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
23+ case SRV_CHECKSUM_ALGORITHM_CRC32:
24+ log_checksum_algorithm_ptr=log_block_calc_checksum_crc32;
25+ break;
26+ case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
27+ case SRV_CHECKSUM_ALGORITHM_NONE:
28+ log_checksum_algorithm_ptr=log_block_calc_checksum_none;
29+ break;
30+ default:
31+ ut_a(0);
32+ }
33+}
34+
35+/****************************************************************//**
36+On update hook for the innodb_log_checksum_algorithm variable. */
37+static
38+void
39+innodb_log_checksum_algorithm_update(
40+/*=================================*/
41+ THD* thd, /*!< in: thread handle */
42+ struct st_mysql_sys_var* var, /*!< in: pointer to
43+ system variable */
44+ void* var_ptr,/*!< out: where the
45+ formal string goes */
46+ const void* save) /*!< in: immediate result
47+ from check function */
48+{
49+ srv_checksum_algorithm_t algorithm;
50+
51+ algorithm = (srv_checksum_algorithm_t)
52+ (*static_cast<const ulong*>(save));
53+
54+ /* Make sure we are the only log user */
55+ mutex_enter(&log_sys->mutex);
56+
57+ innodb_log_checksum_func_update(algorithm);
58+
59+ srv_log_checksum_algorithm = algorithm;
60+
61+ mutex_exit(&log_sys->mutex);
62+}
63+
64 /*********************************************************************//**
65 Copy table flags from MySQL's HA_CREATE_INFO into an InnoDB table object.
66 Those flags are stored in .frm file and end up in the MySQL table object,
67@@ -3487,6 +3543,8 @@
68 srv_checksum_algorithm = SRV_CHECKSUM_ALGORITHM_NONE;
69 }
70
71+ innodb_log_checksum_func_update(srv_log_checksum_algorithm);
72+
73 #ifdef HAVE_LARGE_PAGES
74 if ((os_use_large_pages = (ibool) my_use_large_pages)) {
75 os_large_page_size = (ulint) opt_large_page_size;
76@@ -15759,51 +15817,6 @@
77 }
78
79 /****************************************************************//**
80-Update log_checksum_algorithm_ptr with a pointer to the function corresponding
81-to a given checksum algorithm. */
82-static
83-void
84-innodb_log_checksum_algorithm_update(
85-/*=================================*/
86- THD* thd, /*!< in: thread handle */
87- struct st_mysql_sys_var* var, /*!< in: pointer to
88- system variable */
89- void* var_ptr,/*!< out: where the
90- formal string goes */
91- const void* save) /*!< in: immediate result
92- from check function */
93-{
94- srv_checksum_algorithm_t algorithm;
95-
96- algorithm = (srv_checksum_algorithm_t)
97- (*static_cast<const ulong*>(save));
98-
99- /* Make sure we are the only log user */
100- mutex_enter(&log_sys->mutex);
101-
102- switch (algorithm) {
103- case SRV_CHECKSUM_ALGORITHM_STRICT_INNODB:
104- case SRV_CHECKSUM_ALGORITHM_INNODB:
105- log_checksum_algorithm_ptr=log_block_calc_checksum_innodb;
106- break;
107- case SRV_CHECKSUM_ALGORITHM_STRICT_CRC32:
108- case SRV_CHECKSUM_ALGORITHM_CRC32:
109- log_checksum_algorithm_ptr=log_block_calc_checksum_crc32;
110- break;
111- case SRV_CHECKSUM_ALGORITHM_STRICT_NONE:
112- case SRV_CHECKSUM_ALGORITHM_NONE:
113- log_checksum_algorithm_ptr=log_block_calc_checksum_none;
114- break;
115- default:
116- ut_a(0);
117- }
118-
119- srv_log_checksum_algorithm = algorithm;
120-
121- mutex_exit(&log_sys->mutex);
122-}
123-
124-/****************************************************************//**
125 Parse and enable InnoDB monitor counters during server startup.
126 User can list the monitor counters/groups to be enable by specifying
127 "loose-innodb_monitor_enable=monitor_name1;monitor_name2..."

Subscribers

People subscribed via source and target branches