summaryrefslogtreecommitdiff
path: root/storage/maria/ma_recovery.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge 10.4 into 10.5Marko Mäkelä2020-05-311-6/+15
|\
| * Merge 10.3 into 10.4Marko Mäkelä2020-05-301-6/+15
| |\
| | * Merge 10.2 into 10.3Marko Mäkelä2020-05-271-6/+15
| | |\
| | | * Fixed crash in aria recovery when using bulk insertMonty2020-05-261-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MDEV-20578 Got error 126 when executing undo undo_key_delete upon Aria crash recovery The crash happens in this scenario: - Table with unique keys and non unique keys - Batch insert (LOAD DATA or INSERT ... SELECT) with REPLACE - Some insert succeeds followed by duplicate key error In the above scenario the table gets corrupted. The bug was that we don't generate any undo entry for the failed insert as the whole insert can be ignored by undo. The code did however not take into account that when bulk insert is used, we would write cached keys to the file on failure and undo would wrongly ignore these. Fixed by moving the writing of the cache keys after we write the aborted-insert event to the log.
* | | | Improve logging of Aria redo's and undo'sMonty2020-05-271-39/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Remove extra ',' and quotes - Remove extra newline and remove double newlines - Added options --lsn-redo-end and --lsn-undo-end to aria_read_log - Allow one to give the aria_read_log lsn aruments as number,0xhexnumber, the same way as lsn's are written by aria_read_log - Don't write full pages to redo log with EXTRA_DEBUG as this takes up a lot of disk and there has not been a need for this extra loggging for a long time. Instead one should use EXTRA_ARIA_DEBUG instead.
* | | | Fixed access to undefined memory found by valgrind and MSANMonty2020-05-231-4/+3
| | | | | | | | | | | | | | | | | | | | | | | | When my_vsnprintf() is patched, the code protected disabled with 'WAITING_FOR_BUGFIX_TO_VSPRINTF' should be enabled again. Also all %b formats in this patch should be revert to %s again
* | | | cleanup: PSI key is *always* the first argumentSergei Golubchik2020-03-101-4/+4
| | | |
* | | | perfschema memory related instrumentation changesSergei Golubchik2020-03-101-5/+5
| | | |
* | | | Merge 10.4 into 10.5Oleksandr Byelkin2019-11-071-2/+2
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-11-011-2/+2
| |\ \ \ | | |/ /
| | * | Write error message if aria_log.??????? files are missingMonty2019-10-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can happen if one uses a backup where not all aria_log.* files are copied or if the last one is too short. In this case the data files will contain data that is not in the logs and recovery will fail. Other things: - Fixed tprint() to not print extra new line to debug trace
* | | | Merge 10.4 into 10.5Marko Mäkelä2019-08-131-11/+27
|\ \ \ \ | |/ / /
| * | | Merge 10.3 into 10.4Marko Mäkelä2019-07-251-11/+27
| |\ \ \ | | |/ /
| | * | Merge 10.2 into 10.3Eugene Kosov2019-07-161-11/+27
| | |\ \ | | | |/
| | | * Merge 10.1 into 10.2Eugene Kosov2019-07-091-11/+27
| | | |\
| | | | * Fixed Aria recovery progress printingMichael Widenius2019-06-251-11/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - When recovery failed, errors would not be printed on new lines. - Print more information if file lengths are changed - Added logging of table name for entries INCOMPLETE_LOG and REDO_REPAIR_TABLE
| | | | * Backport aria usage if LSN_FMT from 10.3Michael Widenius2019-06-251-32/+32
| | | | | | | | | | | | | | | | | | | | This helps when merging code between releases
* | | | | Merge 10.4 into 10.5Marko Mäkelä2019-05-231-1/+1
|\ \ \ \ \ | |/ / / /
| * | | | Merge branch '10.3' into 10.4Oleksandr Byelkin2019-05-191-1/+1
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.2 into 10.3Marko Mäkelä2019-05-141-1/+1
| | |\ \ \ | | | |/ /
| | | * | Merge 10.1 into 10.2Marko Mäkelä2019-05-131-1/+1
| | | |\ \ | | | | |/
| | | | * Merge branch '5.5' into 10.1Vicențiu Ciorbaru2019-05-111-1/+1
| | | | |\
| | | | | * Update FSF addressMichal Schorm2019-05-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit is based on the work of Michal Schorm, rebased on the earliest MariaDB version. Th command line used to generate this diff was: find ./ -type f \ -exec sed -i -e 's/Foundation, Inc., 59 Temple Place, Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/Foundation, Inc. 59 Temple Place.* Suite 330, Boston, /Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, /g' {} \; \ -exec sed -i -e 's/MA.*.....-1307.*USA/MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/Foundation, Inc., 59 Temple/Foundation, Inc., 51 Franklin/g' {} \; \ -exec sed -i -e 's/Place, Suite 330, Boston, MA.*02111-1307.*USA/Street, Fifth Floor, Boston, MA 02110-1335 USA/g' {} \; \ -exec sed -i -e 's/MA.*.....-1307/MA 02110-1335/g' {} \;
* | | | | | MDEV-17841 S3 storage engineMonty2019-05-231-7/+7
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A read-only storage engine that stores it's data in (aws) S3 To store data in S3 one could use ALTER TABLE: ALTER TABLE table_name ENGINE=S3 libmarias3 integration done by Sergei Golubchik libmarias3 created by Andrew Hutchings
* | | | | Merge 10.3 into 10.4Marko Mäkelä2019-03-201-0/+13
|\ \ \ \ \ | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MDEV-17262 commit 26432e49d37a37d09b862bb49a021e44bdf4789c was skipped. In Galera 4, the implementation would seem to require changes to the streaming replication. In the tests archive.rnd_pos main.profiling, disable_ps_protocol for SHOW STATUS and SHOW PROFILE commands until MDEV-18974 has been fixed.
| * | | | Merge branch '10.2' into 10.3Sergei Golubchik2019-03-171-0/+13
| |\ \ \ \ | | |/ / /
| | * | | Fixed bug in redo handling of batch insert in AriaMonty2019-03-141-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symptom of the bug was that one got the following in the aria recovery log: "Table 'xxx', id 57, has create_rename_lsn (1,0x12dee) more recent than LOGREC_FILE_ID's LSN (1,0x12dc4), ignoring open request" After this all future redo entries was marked with "For table of short id 57, table skipped, so skipping record" Analyze: When ending batch insert, create_rename_lsn for the table is updated to signal that earlier redo entries for the table can't be applied. The problem was that future redo entries was also ignored as redo code assumed they where for the old table. Fixed by calling translog_dessign_id, which causes future redo entries to be seen as belonging to the updated table.
* | | | | Removing warning from Aria recoveryMonty2019-03-141-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The warning was removed as this is a common case that happens if the table was dropped and later created during the same checkpoint or if there was a bulk insert done on an empty table.
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-11-191-1/+7
|\ \ \ \ \ | |/ / / /
| * | | | Max transid was not stored directly after Aria recoveryMonty2018-11-161-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This caused ma_test_recovery.pl to fail Other things: - Fixed bug where "ma_test_recovert.pl --abort-on-error" didn't abort on error
* | | | | Merge 10.3 into 10.4Marko Mäkelä2018-09-111-3/+8
|\ \ \ \ \ | |/ / / /
| * | | | Merge 10.2 into 10.3Marko Mäkelä2018-09-061-2/+6
| |\ \ \ \ | | |/ / /
| | * | | Merge 10.1 into 10.2Marko Mäkelä2018-08-311-2/+6
| | |\ \ \ | | | |/ /
| | | * | MDEV-15797 Assertion `thd->killed != 0' failed in ha_maria::enable_indexesMonty2018-08-271-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that a parallel open of a table, overwrote info->state that was in used by repair. Fixed by changing _ma_tmp_disable_logging_for_table() to use a new state buffer state.no_logging to store the temporary state. Other things: - Use original number of rows when retrying repair to get rid of a potential warning "Number of rows changed from X to Y" - Changed maria_commit() to make it easier to merge with 10.4 - If table is not locked (like with show commands), use the global number of rows as the local number may not be up to date. (Minor not critical fix) - Added some missing DBUG_RETURN
| * | | | Fixed several issues with aria_chkMonty2018-08-311-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Made output to be aligned in aria_chk -d - Aria engine error texts are now written instead of "Undefined error" - When running with --check --force, tables with wrong TRN's but otherwise correct are now zerofilled - Fixed several bugs in check and recovery related to fulltext - When doing recovery, store highest found TRID in aria_control_file Before this, the
* | | | | MDEV-16421 Make system tables crash safeMichael Widenius2018-08-141-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make all system tables in mysql directory of type engine=Aria Privilege tables are using transactional=1 Statistical tables are using transactional=0, to allow them to be quickly updated with low overhead. Help tables are also using transactional=0 as these are only updated at init time. Other changes: - Aria store engine is now a required engine - Update comment for Aria tables to reflect their new usage - Fixed that _ma_reset_trn_for_table() removes unlocked table from transaction table list. This was needed to allow one to lock and unlock system tables separately from other tables, for example when reading a procedure from mysql.proc - Don't give a warning when using transactional=1 for engines that is using transactions. This is both logical and also to avoid warnings/errors when doing an alter of a privilege table to InnoDB. - Don't abort on warnings from ALTER TABLE for changes that would be accepted by CREATE TABLE. - New created Aria transactional tables are marked as not movable (as they include create_rename_lsn). - bootstrap.test was changed to kill orignal server, as one can't anymore have two servers started at same time on same data directory and data files. - Disable maria.small_blocksize as one can't anymore change aria block size after system tables are created. - Speed up creation of help tables by using lock tables. - wsrep_sst_resync now also copies Aria redo logs.
* | | | | mysys: rename ME_xxx flags to match plugin apiSergei Golubchik2018-06-041-2/+2
|/ / / /
* | | | Merge branch 'github/10.2' into 10.3Sergei Golubchik2018-05-221-0/+3
|\ \ \ \ | |/ / /
| * | | Merge branch '10.1' into 10.2Sergei Golubchik2018-05-201-0/+11
| |\ \ \ | | |/ /
| | * | Merge branch '10.0' into 10.1Sergei Golubchik2018-05-191-0/+11
| | |\ \
| | | * \ Merge branch '5.5' into 10.0Sergei Golubchik2018-05-191-0/+8
| | | |\ \ | | | | |/
| | | | * MDEV-654 Assertion `share->now_transactional' failed in flush_log_for_bitmap ↵Monty2018-05-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on concurrent workload with Aria tables Problem was that we the bitmap needs to be flushed before disabling logging of redo entires, as writing the bitmap to disk by background checkpoint may cause redo entries.
| | | * | MDEV-14943 Alter table ORDER BY bugMonty2018-05-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Problem was that if copy_data_between_tables() didn't do proper clean up in case of failures: - copy object was not properly freed - end_bulk_insert() was not called - mysql_trans_prepare_alter_copy_data() set THD->transaction.on to false which was not properly restored The last part caused a crash in Aria as Aria depends on that THD is correct. Other things: - Reset info->switched_transactional after usage (safety) - Reset bulk_insert_single_undo (safety)
* | | | | MDEV-654 Assertion `share->now_transactional' failed in flush_log_for_bitmap ↵Monty2018-05-151-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | on concurrent workload with Aria tables I was able to repeat the problem with old version of randgen Reason for crash: - It's not safe to change share->now_transactional if there are changed bitmaps in the pagecache as flushing these can cause redo-entries and the bitmap flush code checks that share->now_transactional is set. Fixed by flushing bitmaps in _ma_tmp_disable_logging_for_table() before we set share->now_transactional to 0
* | | | | MDEV-15091 : Windows, 64bit: reenable and fix warning C4267 (conversion from ↵Vladislav Vaintroub2018-02-061-1/+1
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'size_t' to 'type', possible loss of data) Handle string length as size_t, consistently (almost always:)) Change function prototypes to accept size_t, where in the past ulong or uint were used. change local/member variables to size_t when appropriate. This fix excludes rocksdb, spider,spider, sphinx and connect for now.
* | | | Merge branch '10.1' into 10.2Sergei Golubchik2017-10-241-1/+1
|\ \ \ \ | |/ / /
| * | | Merge branch '10.0' into 10.1Sergei Golubchik2017-10-221-1/+1
| |\ \ \ | | |/ /
| | * | Merge branch '5.5' into 10.0Sergei Golubchik2017-10-181-1/+1
| | |\ \ | | | |/
| | | * MDEV-13459 Warnings, when compiling with gcc-7.xSergei Golubchik2017-10-171-1/+1
| | | | | | | | | | | | | | | | mostly caused by -Wimplicit-fallthrough
* | | | MDEV-13384 - misc Windows warnings fixedVladislav Vaintroub2017-09-281-1/+1
| | | |