[MDEV-11375] AliSQL: [Feature] Issue#3 OPTMIZE AND BUGFIX LOG_WRITE_UP_TO Created: 2016-11-29  Updated: 2016-12-17  Resolved: 2016-12-17

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Fix Version/s: N/A

Type: Task Priority: Major
Reporter: Sergey Vojtovich Assignee: Lixun Peng
Resolution: Won't Do Votes: 0
Labels: None

Epic Link: AliSQL patches

 Description   

optimize log_write_up_to, port from upstream
===================
Committer: Yasufumi Kinoshita
Date: 2013-10-17 10:05:54 UTC
Revision ID: yasufumi.kinoshita@oracle.com-20131017100554-aoqvm90a2a2wmdrz
WL#7050 - InnoDB: Refactor redo log write code for better performance
 
- This is rewrite of log_write_up_to() to improve its performance in case where
  innodb_flush_log_at_trx_commit = 2.
 
In log_write_up_to():
 
* Remove wait mode. We always wait with one exception. And that is when doing log
sync from master thread. It makes that synchronous as well because that happens
only once per second.
 
* Because we only have one log group therefore we don't need two flush_events.
* Remove unnecessary fields like written_to_some_lsn, written_to_all_lsn.
* If only write is requested we don't have to acquire the log_sys::mutex after we
release it. We currently do that only to do event handling but event handling is
really only needed in case where flush is requested i.e.: a thread should be
waiting on the event iff it is interested in flushing. Writes are serialized under
log_sys::mutex.
 
This patch was originally written by Inaam Rana.
 
rb#2389 Approved by Sunny and Yasufumi
 
===========
 
Adjustment for performance was done therough inherited rb#3373
 
- optimize log_write_up_to() more
        * remove the second log_sys->mutex obtain also for "innodb_flush_log_at_trx_commit = 1" path
        * remove unnecessary ut_memcpy. (because log_group_write_buf() is protected by log_sys->mutex)
        * remove dirty-read from flush_to_disk=true case. (to avoid regression at some cases)
          (to keep current arbitration for write/fsync contention between log and data file)
        * fix wrong handling of O_DSYNC
- revive log_buffer_sync_in_background(). (because it needs to be used)
 
Bugfix:
===================
bug#73109, skip redo log write when log_sys->buf_free is equal to log_sys->buf_next_to_write

https://github.com/alibaba/AliSQL/commit/950300eceac957c8f97140f07595f6c568508de4



 Comments   
Comment by Sergey Vojtovich [ 2016-11-29 ]

plinux, I think we have this patch in 10.2. Could you verify?

Comment by Sergey Vojtovich [ 2016-12-17 ]

MariaDB 10.2 has this patch merged from MySQL.

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