1

I've started having mysql crashing and restarting. The system has been completely stable, and this has started happening after creating the following table. I successfully inserted about 210,000 records using a INSERT INTO command. But then I noticed the server going down when running simple INSERT and UPDATE and SELECT commands.

For example, the server crashed when I ran the following query: SELECT * FROM tipstrade_2.tblVehicleLookups limit 1

Any hints for identifying the issue would be much appreciated.

CREATE TABLE `tblVehicleLookups` (
  `fldID` int(11) NOT NULL AUTO_INCREMENT,
  `fldTicketID` char(12) NOT NULL,
  `fldVRM` varchar(10) NOT NULL,
  `fldVIN` char(17) NOT NULL,
  `fldMake` varchar(32) NOT NULL,
  `fldModel` varchar(32) NOT NULL,
  `fldVehicle` varchar(255) NOT NULL,
  `fldDiscriminator` varchar(255) NOT NULL,
  `fldData` text NOT NULL,
  `fldPrice` decimal(5,2) DEFAULT NULL,
  `fldFreeAfter` date NOT NULL DEFAULT '0001-01-01',
  `fldIsFree` bit(1) GENERATED ALWAYS AS (`fldFreeAfter` < cast(current_timestamp() as date)) VIRTUAL,
  `fldCreated` datetime NOT NULL DEFAULT current_timestamp(),
  `fldModified` datetime DEFAULT NULL ON UPDATE current_timestamp(),
  `fldCarWebID` int(11) DEFAULT NULL,
  PRIMARY KEY (`fldID`),
  UNIQUE KEY `fldCarWebID` (`fldCarWebID`),
  KEY `fldVRM` (`fldVRM`),
  KEY `fldVIN` (`fldVIN`)
) ENGINE=InnoDB AUTO_INCREMENT=1310702 DEFAULT CHARSET=utf8

error.log

pure virtual method called
terminate called without an active exception
210215 13:12:40 [ERROR] mysqld got signal 6 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see https://mariadb.com/kb/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed, 
something is definitely wrong and this may fail.

Server version: 10.2.36-MariaDB-10.2.36+maria~xenial-log
key_buffer_size=1073741824
read_buffer_size=2097152
max_used_connections=152
max_threads=202
thread_count=153
It is possible that mysqld could use up to 
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 2087104 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x7f016c0009a8
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x7f039d60fcc8 thread_stack 0x49000
/usr/sbin/mysqld(my_print_stacktrace+0x2e)[0x561b050f699e]
/usr/sbin/mysqld(handle_fatal_signal+0x305)[0x561b04ba90d5]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7f0831b60390]
linux/raise.c:54(__GI_raise)[0x7f083112f438]
stdlib/abort.c:91(__GI_abort)[0x7f083113103a]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(_ZN9__gnu_cxx27__verbose_terminate_handlerEv+0x16d)[0x7f083185c84d]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8d6b6)[0x7f083185a6b6]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8d701)[0x7f083185a701]
/usr/lib/x86_64-linux-gnu/libstdc++.so.6(+0x8e23f)[0x7f083185b23f]
/usr/sbin/mysqld(_ZN4Item24get_date_with_conversionEP13st_mysql_timey+0x31)[0x561b04bbdf21]
/usr/sbin/mysqld(+0x459aaa)[0x561b04978aaa]
/usr/sbin/mysqld(_ZN14Arg_comparator16compare_temporalE16enum_field_types+0x4b)[0x561b04bdc09b]
/usr/sbin/mysqld(_ZN12Item_func_lt7val_intEv+0x2f)[0x561b04bd3abf]
/usr/sbin/mysqld(_ZN4Item13save_in_fieldEP5Fieldb+0x15c)[0x561b04bb86cc]
/usr/sbin/mysqld(_ZN5TABLE21update_virtual_fieldsEP7handler21enum_vcol_update_mode+0x13b)[0x561b04aba0bb]
/usr/sbin/mysqld(_ZN7handler11ha_rnd_nextEPh+0x1ba)[0x561b04badada]
/usr/sbin/mysqld(_Z13rr_sequentialP11READ_RECORD+0x35)[0x561b04cb7cc5]
/usr/sbin/mysqld(_Z10sub_selectP4JOINP13st_join_tableb+0x164)[0x561b04a3e5e4]
/usr/sbin/mysqld(_ZN4JOIN10exec_innerEv+0xb8b)[0x561b04a5e76b]
/usr/sbin/mysqld(_ZN4JOIN4execEv+0x33)[0x561b04a5e973]
/usr/sbin/mysqld(_Z12mysql_selectP3THDP10TABLE_LISTjR4ListI4ItemEPS4_jP8st_orderS9_S7_S9_yP13select_resultP18st_select_lex_unitP13st_select_lex+0xeb)[0x561b04a5eabb]
/usr/sbin/mysqld(_Z13handle_selectP3THDP3LEXP13select_resultm+0x12f)[0x561b04a5f3cf]
/usr/sbin/mysqld(+0x41b779)[0x561b0493a779]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x32ac)[0x561b04a08d5c]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_statebb+0x26e)[0x561b04a0e24e]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcjbb+0xba6)[0x561b04a0fb26]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x10c)[0x561b04a1184c]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP7CONNECT+0x272)[0x561b04adfae2]
/usr/sbin/mysqld(handle_one_connection+0x3d)[0x561b04adfc3d]
/usr/sbin/mysqld(+0x818891)[0x561b04d37891]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x76ba)[0x7f0831b566ba]
x86_64/clone.S:111(clone)[0x7f08312014dd]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f016c00f120): SELECT * FROM tipstrade_2.tblVehicleLookups
limit 1

Connection ID (thread ID): 8202
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=on,orderby_uses_equalities=on,condition_pushdown_for_derived=on

The manual page at https://mariadb.com/kb/en/how-to-produce-a-full-stack-trace-for-mysqld/ contains
information that should help you find out what is causing the crash.
Writing a core file...
Working directory at /home/mysql
Resource Limits:
Limit                     Soft Limit           Hard Limit           Units     
Max cpu time              unlimited            unlimited            seconds   
Max file size             unlimited            unlimited            bytes     
Max data size             unlimited            unlimited            bytes     
Max stack size            8388608              unlimited            bytes     
Max core file size        0                    unlimited            bytes     
Max resident set          unlimited            unlimited            bytes     
Max processes             256349               256349               processes 
Max open files            65533                65533                files     
Max locked memory         65536                65536                bytes     
Max address space         unlimited            unlimited            bytes     
Max file locks            unlimited            unlimited            locks     
Max pending signals       256349               256349               signals   
Max msgqueue size         819200               819200               bytes     
Max nice priority         0                    0                    
Max realtime priority     0                    0                    
Max realtime timeout      unlimited            unlimited            us        
Core pattern: |/usr/share/apport/apport %p %s %c %d %P %E

2021-02-15 13:12:51 140611253319872 [Note] Using unique option prefix 'myisam_recover' is error-prone and can break in the future. Please use the full name 'myisam-recover-options' instead.
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Uses event mutexes
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Compressed tables use zlib 1.2.8
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Using Linux native AIO
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Number of pools: 1
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Using SSE2 crc32 instructions
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Initializing buffer pool, total size = 16G, instances = 16, chunk size = 128M
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Completed initialization of buffer pool
2021-02-15 13:12:51 140591352649472 [Note] InnoDB: If the mysqld execution user is authorized, page cleaner thread priority can be changed. See the man page of setpriority().
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Highest supported file format is Barracuda.
2021-02-15 13:12:51 140611253319872 [Note] InnoDB: Starting crash recovery from checkpoint LSN=513506676876
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: Last binlog file './tipstrade04-bin.004023', position 29799719
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: 128 out of 128 rollback segments are active.
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: Removed temporary tablespace data file: "ibtmp1"
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: Creating shared tablespace for temporary tables
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: Setting file '/var/lib/mysql/ibtmp1' size to 12 MB. Physically writing the file full; Please wait ...
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: File '/var/lib/mysql/ibtmp1' size is now 12 MB.
2021-02-15 13:12:52 140611253319872 [Note] InnoDB: 5.7.32 started; log sequence number 513506676885
2021-02-15 13:12:52 140591702722304 [Note] InnoDB: Loading buffer pool(s) from /home/mysql/ib_buffer_pool
2021-02-15 13:12:52 140611253319872 [Note] Plugin 'FEEDBACK' is disabled.
2021-02-15 13:12:52 140611253319872 [Note] Recovering after a crash using tipstrade04-bin
2021-02-15 13:12:52 140611253319872 [Note] Starting crash recovery...
2021-02-15 13:12:52 140611253319872 [Note] Crash recovery finished.
2021-02-15 13:12:52 140611253319872 [Note] Server socket created on IP: '::'.
2021-02-15 13:12:52 140611253319872 [Warning] 'proxies_priv' entry '@% root@tipstrade03' ignored in --skip-name-resolve mode.
2021-02-15 13:12:52 140611253319872 [ERROR] mysqld: Table './mysql/event' is marked as crashed and should be repaired
2021-02-15 13:12:52 140611253319872 [Warning] Checking table:   './mysql/event'
2021-02-15 13:12:52 140611253319872 [ERROR] mysql.event: 1 client is using or hasn't closed the table properly
2021-02-15 13:12:52 140611060475648 [Note] Event Scheduler: scheduler thread started with id 7
2021-02-15 13:12:52 140611253319872 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.2.36-MariaDB-10.2.36+maria~xenial-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  mariadb.org binary distribution
2021-02-15 13:12:55 140609785124608 [ERROR] mysqld: Table './asteriskcdrdb/cel' is marked as crashed and should be repaired
2021-02-15 13:12:55 140609785124608 [Warning] Checking table:   './asteriskcdrdb/cel'
2021-02-15 13:12:56 140609782699776 [ERROR] mysqld: Table './asteriskcdrdb/cdr' is marked as crashed and should be repaired
2021-02-15 13:12:56 140609782699776 [Warning] Checking table:   './asteriskcdrdb/cdr'
2021-02-15 13:13:03 140611059566336 [ERROR] mysqld: Table './tipstrade_2/tblTicketsOffers' is marked as crashed and should be repaired
2021-02-15 13:13:03 140611059566336 [Warning] Checking table:   './tipstrade_2/tblTicketsOffers'
2021-02-15 13:13:16 140591702722304 [Note] InnoDB: Buffer pool(s) load completed at 210215 13:13:16
2021-02-15 13:26:53 140591588833024 [ERROR] mysqld: Table './tipstrade_2/tblPrintQueue' is marked as crashed and should be repaired
2021-02-15 13:26:53 140591588833024 [Warning] Checking table:   './tipstrade_2/tblPrintQueue'

System info

  • Ubuntu 16.04.7 LTS \n \l
  • 10.2.36-MariaDB-10.2.36+maria~xenial-log
  • Linux 4.4.0-201-generic #233-Ubuntu SMP Thu Jan 14 06:10:28 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
  • ProLiant DL360 Gen9

Output from free

              total        used        free      shared  buff/cache   available
Mem:       65838544     9670572    11002756      170796    45165216    55299216
Swap:       7812092       19924     7792168
  • If you are not using any MyISAM tables, lower key_buffer_size to 40M. Sorry, I don't think it will solve the problem. – Rick James Mar 01 '21 at 17:42
  • Thanks, Yup, I'm still using some MyISAM tables (probably should convert them at some stage). In the end I upgraded to 10.5, and haven't seen any issues since. – TipsTrade Ltd. Mar 03 '21 at 12:17

1 Answers1

0

I never got to the bottom of this. In the end I bit the bullet, and upgraded from 10.2 -> 10.3 -> 10.4 -> 10.5, ensuring I ran mysql_upgrade between every update (along with a full backup of the mysql datadir, which came in handy!).

Since then, I've been happily reading, inserting, updating and deleting hundreds of thousands of records in the offending table and the DB hasn't skipped a beat.

The only explanations I have were:

  1. The warning "This could be because you hit a bug. It is also possible that this binary or one of the libraries it was linked against is corrupt, improperly built, or misconfigured." was correct, and upgrading the server and dependencies fixed the issue.
  2. There was table corruption, and mysql_upgrade fixed the issue.

I've discounted a hardware error seeing as it's all working again. Also ILO wasn't giving me any warnings.