[MDEV-7955] WSREP() appears on radar in OLTP RO Created: 2015-04-09  Updated: 2017-09-27  Resolved: 2017-01-03

Status: Closed
Project: MariaDB Server
Component/s: Galera
Affects Version/s: 10.1
Fix Version/s: 10.1.21

Type: Bug Priority: Major
Reporter: Sergey Vojtovich Assignee: Sachin Setiya (Inactive)
Resolution: Fixed Votes: 0
Labels: None

Issue Links:
Problem/Incident
causes MDEV-13787 Crash in persistent stats wsrep_on (t... Closed
Epic Link: Performance: micro optimizations
Sprint: 5.5.54

 Description   

Data comes from Sandy Bridge system running sysbench OLTP RO in 1 thread against 1 table.

Time to time I can see WSREP() macro taking considerable amount of time. Since it is used quite frequently I'd suggest to optimize it a bit. Original macro is as following:

#define WSREP_ON \
  (global_system_variables.wsrep_on)
 
#define WSREP(thd) \
  (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))

  • there should be no need to check "thd" - in most (if not all) cases it should be available
  • there should be no need to check "wsrep" - make sure it is set inline with wsrep_on
  • there should be no need to check "global_system_variables.wsrep_on"

This leaves

#define WSREP(thd) (thd)->variables.wsrep_on



 Comments   
Comment by Nirbhay Choubey (Inactive) [ 2017-01-03 ]

Patch : http://lists.askmonty.org/pipermail/commits/2016-December/010341.html

Generated at Thu Feb 08 07:23:34 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.