File: log_fill_block.inc

package info (click to toggle)
mysql-8.0 8.0.43-3
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 1,273,924 kB
  • sloc: cpp: 4,684,605; ansic: 412,450; pascal: 108,398; java: 83,641; perl: 30,221; cs: 27,067; sql: 26,594; sh: 24,181; python: 21,816; yacc: 17,169; php: 11,522; xml: 7,388; javascript: 7,076; makefile: 2,194; lex: 1,075; awk: 670; asm: 520; objc: 183; ruby: 97; lisp: 86
file content (47 lines) | stat: -rw-r--r-- 1,418 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# Enable all METRICS within log module
SET GLOBAL innodb_monitor_enable = module_log;

--source ../include/log_read_current_lsn.inc
--let $start_lsn = $current_lsn

SET GLOBAL DEBUG = "+d,trx_commit_to_the_end_of_log_block";

SET AUTOCOMMIT = 0;

eval $log_fill_block_sql;

if ($log_fill_block_and_crash == 1) {
  # Crash just before writing a next incomplete log block
  if ($debug_test) {
    --source ../include/log_read_current_lsn.inc
    --echo State: creating trx ending at blocks boundary
    --echo Start LSN: $start_lsn
    --echo Before COMMIT LSN: $current_lsn
  }

  SET GLOBAL DEBUG = "+d,crash_log_writer_before_write_new_incomplete_block";

  # We will crash during log writer's attempt to write 12 bytes of the header of the next block
  --source include/expect_crash.inc

  # COMMIT must not report it succeeded without writing the extra 12 bytes of the next block.
  --error 2013
}
COMMIT;

if ($log_fill_block_and_crash == 0) {
  SET GLOBAL DEBUG = "-d,trx_commit_to_the_end_of_log_block";

  --source ../include/log_read_current_lsn.inc
  --let $end_lsn = $current_lsn

  --let $assert_text = We failed to create log records that would end at boundary between blocks
  --let $assert_cond = [SELECT $end_lsn MOD 512] = 12
  --source include/assert.inc

  if ($debug_test) {
    --echo State: created trx ending at blocks boundary
    --echo Start LSN: $start_lsn
    --echo End LSN: $end_lsn
  }
}