[MDEV-11705] InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log Created: 2017-01-02  Updated: 2017-01-03  Resolved: 2017-01-03

Status: Closed
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.2
Fix Version/s: 10.2.4

Type: Bug Priority: Critical
Reporter: Elena Stepanova Assignee: Jan Lindström (Inactive)
Resolution: Fixed Votes: 0
Labels: None


 Description   

To reproduce,

  • start debug server on a clean datadir with innodb-scrub-log=on, otherwise defaults;
  • wait for a few seconds

2017-01-02 17:22:54 0x7f5967ffc700  InnoDB: Assertion failure in file /data/src/10.2/storage/innobase/log/log0log.cc line 364
InnoDB: Failing assertion: (&log_sys->mutex)->is_owned()
 
#5  0x00007f59ab0b9448 in __GI_abort () at abort.c:89
#6  0x00007f59ae268bae in ut_dbg_assertion_failed (expr=0x7f59ae758f87 "(&log_sys->mutex)->is_owned()", file=0x7f59ae758f58 "/data/src/10.2/storage/innobase/log/log0log.cc", line=364) at /data/src/10.2/storage/innobase/ut/ut0dbg.cc:59
#7  0x00007f59ae0d30f0 in log_reserve_and_open (len=512) at /data/src/10.2/storage/innobase/log/log0log.cc:364
#8  0x00007f59ae0d8cfb in log_pad_current_log_block () at /data/src/10.2/storage/innobase/log/log0log.cc:2543
#9  0x00007f59ae0d8dd1 in log_scrub () at /data/src/10.2/storage/innobase/log/log0log.cc:2578
#10 0x00007f59ae0d8e6d in log_scrub_thread (arg=0x0) at /data/src/10.2/storage/innobase/log/log0log.cc:2610
#11 0x00007f59ad1be0a4 in start_thread (arg=0x7f5967ffc700) at pthread_create.c:309
#12 0x00007f59ab16b87d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111



 Comments   
Comment by Jan Lindström (Inactive) [ 2017-01-03 ]

http://lists.askmonty.org/pipermail/commits/2017-January/010369.html

Comment by Marko Mäkelä [ 2017-01-03 ]

The patch looks otherwise OK to me, but in the test, I think that instead of SLEEP(5), we should use include/wait_condition.inc to wait that the counter is advancing. That would make the test run normally faster, and it would avoid random test failures in a loaded test environment where nothing might happen during the 5-second wait.

Comment by Jan Lindström (Inactive) [ 2017-01-03 ]

commit 403f6e96070a3f35745d4d59d12e222d21ac4f38
Author: Jan Lindström <jan.lindstrom@mariadb.com>
Date: Tue Jan 3 11:22:09 2017 +0200

MDEV-11705: InnoDB: Failing assertion: (&log_sys->mutex)->is_owned() if server started with innodb-scrub-log

Problem was that log_scrub function did not take required log_sys mutex.

Background: Unused space in log blocks are padded with MLOG_DUMMY_RECORD if innodb-scrub-log
is enabled. As log files are written on circular fashion old log blocks can be reused
later for new redo-log entries. Scrubbing pads unused space in log blocks to avoid visibility
of the possible old redo-log contents.

log_scrub(): Take log_sys mutex

log_pad_current_log_block(): Increase srv_stats.n_log_scrubs if padding is done.

srv0srv.cc: Set srv_stats.n_log_scrubs to export vars innodb_scrub_log

ha_innodb.cc: Export innodb_scrub_log to global status.

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