-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
MDEV-37949: Implement innodb_log_archive, innodb_log_recovery_start, innodb_log_recovery_target, … #4405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MDEV-37949: Implement innodb_log_archive, innodb_log_recovery_start, innodb_log_recovery_target, … #4405
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2651,7 +2651,7 @@ static void log_hdr_init() | |
| MYSQL_VERSION_ID / 10000, MYSQL_VERSION_ID / 100 % 100, | ||
| MYSQL_VERSION_ID % 100); | ||
| if (log_sys.is_encrypted()) | ||
| log_crypt_write_header(log_hdr_buf + LOG_HEADER_CREATOR_END); | ||
| log_crypt_write_header(log_hdr_buf + LOG_HEADER_CREATOR_END, false); | ||
| mach_write_to_4(508 + log_hdr_buf, my_crc32c(0, log_hdr_buf, 508)); | ||
| mach_write_to_8(log_hdr_buf + 0x1000, log_sys.last_checkpoint_lsn); | ||
| mach_write_to_8(log_hdr_buf + 0x1008, recv_sys.lsn); | ||
|
|
@@ -2710,7 +2710,7 @@ static bool innodb_init() | |
| srv_log_group_home_dir= xtrabackup_target_dir; | ||
|
|
||
| bool ret; | ||
| const std::string ib_logfile0{get_log_file_path()}; | ||
| const std::string ib_logfile0{log_sys.get_circular_path()}; | ||
| os_file_delete_if_exists_func(ib_logfile0.c_str(), nullptr); | ||
| os_file_t file= os_file_create_func(ib_logfile0.c_str(), | ||
| OS_FILE_CREATE, | ||
|
|
@@ -4890,6 +4890,8 @@ static bool backup_wait_for_commit_lsn() | |
| lsn_t last_lsn= recv_sys.lsn; | ||
|
|
||
| /* read the latest checkpoint lsn */ | ||
| log_sys.last_checkpoint_lsn= 0; | ||
| recv_sys.file_checkpoint= 0; | ||
| if (recv_sys.find_checkpoint() == DB_SUCCESS && log_sys.is_latest()) | ||
| { | ||
| metadata_to_lsn= log_sys.last_checkpoint_lsn; | ||
|
|
@@ -5487,6 +5489,7 @@ static bool xtrabackup_backup_func() | |
|
|
||
| srv_n_purge_threads = 1; | ||
| srv_read_only_mode = TRUE; | ||
| recv_sys.rpo = LSN_MAX; | ||
|
|
||
| srv_operation = SRV_OPERATION_BACKUP; | ||
| log_file_op = backup_file_op; | ||
|
|
@@ -5578,10 +5581,11 @@ static bool xtrabackup_backup_func() | |
|
|
||
| /* open the log file */ | ||
| memset(&stat_info, 0, sizeof(MY_STAT)); | ||
| dst_log_file = ds_open(backup_datasinks.m_redo, LOG_FILE_NAME, &stat_info); | ||
| dst_log_file = | ||
|
dr-m marked this conversation as resolved.
|
||
| ds_open(backup_datasinks.m_redo, "ib_logfile0", &stat_info); | ||
| if (dst_log_file == NULL) { | ||
| msg("Error: failed to open the target stream for '%s'.", | ||
| LOG_FILE_NAME); | ||
| msg("Error: failed to open the target stream" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Noticing a silent crash, please check if it's related Please take a look
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It looks like there was a possible anomaly at When I attach GDB to the crashed No buffer page access code path should be changed in this pull request, so in any case it should not be related to these changes. This could be a bug in the underlying Linux kernel or in the way how There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. shall we open a seperate MDEV for this issue?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If you can reproduce and diagnose the problem, you could file a bug against https://github.com/rr-debugger/rr/. It could be a race condition between |
||
| " for 'ib_logfile0'."); | ||
| goto fail; | ||
| } | ||
|
|
||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| --disable_query_log | ||
| SET STATEMENT sql_log_bin=0 FOR | ||
| call mtr.add_suppression("Plugin 'InnoDB' registration as a STORAGE ENGINE failed\\."); | ||
| SET STATEMENT sql_log_bin=0 FOR | ||
| call mtr.add_suppression("InnoDB: Plugin initialization aborted"); | ||
| SET STATEMENT sql_log_bin=0 FOR | ||
| call mtr.add_suppression("InnoDB: ib_0.*\\.log does not match innodb_encrypt_log"); | ||
| --enable_query_log | ||
| if (`SELECT COUNT(*)=0 FROM information_schema.global_variables where variable_name='innodb_log_archive' and variable_value='OFF'`) | ||
| { | ||
| --skip Test requires innodb_log_archive=OFF | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -20,6 +20,13 @@ AND support IN ('YES', 'DEFAULT', 'ENABLED'); | |
| ENGINE SUPPORT COMMENT TRANSACTIONS XA SAVEPOINTS | ||
| FOUND 1 /InnoDB: Upgrade after a crash is not supported. This redo log was created before MariaDB 10\.2\.2, and we did not find a valid checkpoint/ in mysqld.1.err | ||
| # empty redo log from before MariaDB 10.2.2 | ||
| # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-recovery-target=12345 | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. getting this error :- Log files present at SDP:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Recovery will only consider the all-zero file To analyze the root cause of this failure, I would need a log that shows the sequence of events that led to this file being created during a previous execution of
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The revision to the spare archive log creation is now included in c819703. |
||
| SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES | ||
| WHERE engine = 'innodb' | ||
| AND support IN ('YES', 'DEFAULT', 'ENABLED'); | ||
| COUNT(*) | ||
| 0 | ||
| FOUND 1 /InnoDB: cannot fulfill innodb_log_recovery_target=12345!=/ in mysqld.1.err | ||
| # restart: --innodb-data-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-log-group-home-dir=MYSQLTEST_VARDIR/tmp/log_corruption --innodb-force-recovery=5 --innodb-log-file-size=4m | ||
| SELECT COUNT(*) FROM INFORMATION_SCHEMA.ENGINES | ||
| WHERE engine = 'innodb' | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.