| 1 |
SET GLOBAL innodb_log_checkpoint_now = 1; |
| 2 |
# Initial state: |
| 3 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 4 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 5 |
variable_name variable_value |
| 6 |
Innodb_redo_log_capacity_resized 10485760 |
| 7 |
# Resize redo log to 100M: |
| 8 |
SET GLOBAL innodb_redo_log_capacity = 100*1024*1024; |
| 9 |
Pattern "User has set innodb_redo_log_capacity to 100M" found |
| 10 |
Pattern "Redo log has been resized to 100M" found |
| 11 |
# Current state: |
| 12 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 13 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 14 |
variable_name variable_value |
| 15 |
Innodb_redo_log_capacity_resized 104857600 |
| 16 |
# Create connection which generates spam to the redo log. |
| 17 |
CALL log_spammer(); |
| 18 |
# Disable checkpointing to ensure redo would grow and to allow test of redo-resize cancellation. |
| 19 |
SET GLOBAL innodb_checkpoint_disabled = 1; |
| 20 |
# Wait until redo occupies at least 10MB |
| 21 |
# Start resizing down the redo log (spammer is working in background) |
| 22 |
SET GLOBAL innodb_redo_log_capacity = 9*1024*1024; |
| 23 |
Pattern "User has set innodb_redo_log_capacity to 9M" found |
| 24 |
Pattern "Redo log has been requested to resize from 100M to 9M" found |
| 25 |
# Expected - not found: |
| 26 |
Pattern "Redo log has been resized to 9M" not found |
| 27 |
# Checkpoint is still disabled so resize hasn't been finished. Cancel the resize. |
| 28 |
SET GLOBAL innodb_redo_log_capacity = 102*1024*1024; |
| 29 |
Pattern "User has set innodb_redo_log_capacity to 102M" found |
| 30 |
Pattern "Redo log resize has been cancelled" found |
| 31 |
Pattern "Redo log has been resized to 102M" found |
| 32 |
# Restart resizing down. |
| 33 |
SET GLOBAL innodb_redo_log_capacity = 8*1024*1024; |
| 34 |
Pattern "User has set innodb_redo_log_capacity to 8M" found |
| 35 |
Pattern "Redo log has been requested to resize from 102M to 8M" found |
| 36 |
# Expected - not found: |
| 37 |
Pattern "Redo log has been resized to 8M" not found |
| 38 |
SET GLOBAL innodb_checkpoint_disabled = 0; |
| 39 |
# Waiting for status = OK.... |
| 40 |
Pattern "Redo log has been resized to 8M" found |
| 41 |
# Current state: |
| 42 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 43 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 44 |
variable_name variable_value |
| 45 |
Innodb_redo_log_capacity_resized 8388608 |
| 46 |
Checking if total size of redo log files does not exceed 8388608 bytes |
| 47 |
# Kill and restart mysql: |
| 48 |
# Kill and restart |
| 49 |
# Initial state: |
| 50 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 51 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 52 |
variable_name variable_value |
| 53 |
Innodb_redo_log_capacity_resized 10485760 |
| 54 |
# Resize redo log to 500M: |
| 55 |
SET GLOBAL innodb_redo_log_capacity = 500*1024*1024; |
| 56 |
# Current state: |
| 57 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 58 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 59 |
variable_name variable_value |
| 60 |
Innodb_redo_log_capacity_resized 524288000 |
| 61 |
# Create connection which generates spam to the redo log. |
| 62 |
CALL log_spammer(); |
| 63 |
# Wait until redo occupies at least 10MB |
| 64 |
# Kill and restart mysql with --innodb-redo-log-capacity=1G: |
| 65 |
# Kill and restart: --innodb-redo-log-capacity=1G |
| 66 |
# Initial state: |
| 67 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 68 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 69 |
variable_name variable_value |
| 70 |
Innodb_redo_log_capacity_resized 1073741824 |
| 71 |
# Start resizing down the redo log (spammer is NOT working in background) |
| 72 |
SET GLOBAL innodb_redo_log_capacity = 8*1024*1024; |
| 73 |
# Waiting for status = OK.... |
| 74 |
# Current state: |
| 75 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 76 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 77 |
variable_name variable_value |
| 78 |
Innodb_redo_log_capacity_resized 8388608 |
| 79 |
Checking if total size of redo log files does not exceed 8388608 bytes |
| 80 |
# Create connection which generates spam to the redo log. |
| 81 |
CALL log_spammer(); |
| 82 |
# Resize redo log to 1GB: |
| 83 |
SET GLOBAL innodb_redo_log_capacity = 1024*1024*1024; |
| 84 |
# Current state: |
| 85 |
SELECT variable_name, variable_value FROM performance_schema.global_status |
| 86 |
WHERE variable_name = 'Innodb_redo_log_capacity_resized'; |
| 87 |
variable_name variable_value |
| 88 |
Innodb_redo_log_capacity_resized 1073741824 |
| 89 |
# Wait until redo occupies at least 20MB |
| 90 |
# Kill and restart mysql without --innodb-redo-log-capacity |
| 91 |
# Kill and restart: |
| 92 |
Pattern "Redo log has been requested to resize from .* to .*M" found |