I'm trying to import a database by bringing over the .ibd files from another server (which were saved after tables were flushed and locked), running the "alter table X discard tablespace" for each table and then copying the file over and running "alter table X import tablespace". I disable foreign key checks prior to importing each table.
the sequence of import statements works correctly for most tables. When it reaches a table that is about 4GB large, but with large records, I get a SEGV crash. This happens consistently for the same table. Weird thing is that a 6GB table (but "thin") works OK.
Error in log is:
2017-03-29 9:25:56 139871748651776 [Note] InnoDB: Sync to disk
2017-03-29 9:26:00 139871748651776 [Note] InnoDB: Sync to disk - done!
2017-03-29 9:26:00 139871748651776 [Note] InnoDB: Phase I - Update all pages
2017-03-29 9:27:18 139871748651776 [Note] InnoDB: Sync to disk
2017-03-29 9:27:21 139871748651776 [Note] InnoDB: Sync to disk - done!
2017-03-29 9:27:22 139871748651776 [Note] InnoDB: Phase III - Flush changes to disk
2017-03-29 9:27:22 139871748651776 [Note] InnoDB: Phase IV - Flush complete
170329 9:27:22 [ERROR] mysqld got signal 11 ;
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.1.22-MariaDB
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=1
max_threads=502
thread_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 1233714 K bytes of memory
Hope that's ok; if not, decrease some variables in the equation.
Thread pointer: 0x7f3622a42008
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 = 0x7f366de47110 thread_stack 0x48400
/usr/sbin/mysqld(my_print_stacktrace+0x2b)[0x7f366e984fbb]
/usr/sbin/mysqld(handle_fatal_signal+0x4d5)[0x7f366e4dfbe5]
/lib64/libpthread.so.0(+0xf7e0)[0x7f366dae17e0]
/usr/sbin/mysqld(+0x7a4fd0)[0x7f366e6b5fd0]
/usr/sbin/mysqld(+0x7fa283)[0x7f366e70b283]
/usr/sbin/mysqld(+0x72c2cd)[0x7f366e63d2cd]
/usr/sbin/mysqld(+0x73327d)[0x7f366e64427d]
/usr/sbin/mysqld(_Z34mysql_discard_or_import_tablespaceP3THDP10TABLE_LISTb+0xe8)[0x7f366e3ef2f8]
/usr/sbin/mysqld(_ZN33Sql_cmd_discard_import_tablespace7executeEP3THD+0xc8)[0x7f366e436d88]
/usr/sbin/mysqld(_Z21mysql_execute_commandP3THD+0x152d)[0x7f366e36b03d]
/usr/sbin/mysqld(_Z11mysql_parseP3THDPcjP12Parser_state+0x324)[0x7f366e372934]
/usr/sbin/mysqld(_Z16dispatch_command19enum_server_commandP3THDPcj+0x22a3)[0x7f366e3753b3]
/usr/sbin/mysqld(_Z10do_commandP3THD+0x151)[0x7f366e375931]
/usr/sbin/mysqld(_Z24do_handle_one_connectionP3THD+0x17f)[0x7f366e4348bf]
/usr/sbin/mysqld(handle_one_connection+0x47)[0x7f366e4349f7]
/usr/sbin/mysqld(+0x960c8d)[0x7f366e871c8d]
/lib64/libpthread.so.0(+0x7aa1)[0x7f366dad9aa1]
/lib64/libc.so.6(clone+0x6d)[0x7f366bfbdaad]
Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x7f364a42c020): is an invalid pointer
Connection ID (thread ID): 230
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=off
The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
We think the query pointer is invalid, but we will try to print it anyway.
Query: ALTER TABLE RTODATA_T IMPORT TABLESPACE
170329 09:27:22 mysqld_safe Number of processes running now: 0
170329 09:27:22 mysqld_safe mysqld restarted
From the output it would seem like the calculation of memory usage says that MariaDB could use up to a little bit more than 1GB of memory, which should be OK since this server has 8GB of memory.
Am I doing something wrong? I tried searching for this kind of crash but couldn't find much.
{"report":{"fcp":1535.5999994277954,"ttfb":318.69999980926514,"pageVisibility":"visible","entityId":60774,"key":"jira.project.issue.view-issue","isInitial":true,"threshold":1000,"elementTimings":{},"userDeviceMemory":8,"userDeviceProcessors":64,"apdex":0.5,"journeyId":"87573d27-1de3-4d5d-9781-a6ae46b663e2","navigationType":0,"readyForUser":1616.5,"redirectCount":0,"resourceLoadedEnd":1894.0999994277954,"resourceLoadedStart":324,"resourceTiming":[{"duration":713.1999998092651,"initiatorType":"link","name":"https://jira.mariadb.org/s/2c21342762a6a02add1c328bed317ffd-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/css/_super/batch.css","startTime":324,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":324,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1037.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":713.1999998092651,"initiatorType":"link","name":"https://jira.mariadb.org/s/7ebd35e77e471bc30ff0eba799ebc151-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/css/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":324.3999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":324.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1037.5999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":722.3999996185303,"initiatorType":"script","name":"https://jira.mariadb.org/s/0917945aaa57108d00c5076fea35e069-CDN/lu2cib/820016/12ta74/0a8bac35585be7fc6c9cc5a0464cd4cf/_/download/contextbatch/js/_super/batch.js?locale=en","startTime":324.5,"connectEnd":324.5,"connectStart":324.5,"domainLookupEnd":324.5,"domainLookupStart":324.5,"fetchStart":324.5,"redirectEnd":0,"redirectStart":0,"requestStart":324.5,"responseEnd":1046.8999996185303,"responseStart":1046.8999996185303,"secureConnectionStart":324.5},{"duration":759.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/2d8175ec2fa4c816e8023260bd8c1786-CDN/lu2cib/820016/12ta74/2bf333562ca6724060a9d5f1535471f6/_/download/contextbatch/js/jira.browse.project,project.issue.navigator,jira.view.issue,jira.general,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":324.69999980926514,"connectEnd":324.69999980926514,"connectStart":324.69999980926514,"domainLookupEnd":324.69999980926514,"domainLookupStart":324.69999980926514,"fetchStart":324.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":324.69999980926514,"responseEnd":1083.7999992370605,"responseStart":1083.6999998092651,"secureConnectionStart":324.69999980926514},{"duration":763,"initiatorType":"script","name":"https://jira.mariadb.org/s/a9324d6758d385eb45c462685ad88f1d-CDN/lu2cib/820016/12ta74/c92c0caa9a024ae85b0ebdbed7fb4bd7/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en","startTime":325,"connectEnd":325,"connectStart":325,"domainLookupEnd":325,"domainLookupStart":325,"fetchStart":325,"redirectEnd":0,"redirectStart":0,"requestStart":325,"responseEnd":1088,"responseStart":1088,"secureConnectionStart":325},{"duration":763.3000001907349,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":325.19999980926514,"connectEnd":325.19999980926514,"connectStart":325.19999980926514,"domainLookupEnd":325.19999980926514,"domainLookupStart":325.19999980926514,"fetchStart":325.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":325.19999980926514,"responseEnd":1088.5,"responseStart":1088.5,"secureConnectionStart":325.19999980926514},{"duration":763.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":325.3999996185303,"connectEnd":325.3999996185303,"connectStart":325.3999996185303,"domainLookupEnd":325.3999996185303,"domainLookupStart":325.3999996185303,"fetchStart":325.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":325.3999996185303,"responseEnd":1088.8999996185303,"responseStart":1088.8999996185303,"secureConnectionStart":325.3999996185303},{"duration":869.6999998092651,"initiatorType":"link","name":"https://jira.mariadb.org/s/b04b06a02d1959df322d9cded3aeecc1-CDN/lu2cib/820016/12ta74/a2ff6aa845ffc9a1d22fe23d9ee791fc/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":325.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1195.1999998092651,"responseStart":0,"secureConnectionStart":0},{"duration":763.6999998092651,"initiatorType":"script","name":"https://jira.mariadb.org/rest/api/1.0/shortcuts/820016/47140b6e0a9bc2e4913da06536125810/shortcuts.js?context=issuenavigation&context=issueaction","startTime":325.69999980926514,"connectEnd":325.69999980926514,"connectStart":325.69999980926514,"domainLookupEnd":325.69999980926514,"domainLookupStart":325.69999980926514,"fetchStart":325.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":325.69999980926514,"responseEnd":1089.3999996185303,"responseStart":1089.3999996185303,"secureConnectionStart":325.69999980926514},{"duration":869.5,"initiatorType":"link","name":"https://jira.mariadb.org/s/3ac36323ba5e4eb0af2aa7ac7211b4bb-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.css?jira.create.linked.issue=true","startTime":325.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":325.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1195.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":764,"initiatorType":"script","name":"https://jira.mariadb.org/s/5d5e8fe91fbc506585e83ea3b62ccc4b-CDN/lu2cib/820016/12ta74/d176f0986478cc64f24226b3d20c140d/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-project.issue.navigator,-jira.view.issue/batch.js?jira.create.linked.issue=true&locale=en","startTime":325.8999996185303,"connectEnd":325.8999996185303,"connectStart":325.8999996185303,"domainLookupEnd":325.8999996185303,"domainLookupStart":325.8999996185303,"fetchStart":325.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":325.8999996185303,"responseEnd":1089.8999996185303,"responseStart":1089.8999996185303,"secureConnectionStart":325.8999996185303},{"duration":1069.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":332.3999996185303,"connectEnd":332.3999996185303,"connectStart":332.3999996185303,"domainLookupEnd":332.3999996185303,"domainLookupStart":332.3999996185303,"fetchStart":332.3999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":332.3999996185303,"responseEnd":1401.8999996185303,"responseStart":1401.8999996185303,"secureConnectionStart":332.3999996185303},{"duration":1530.5,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":333,"connectEnd":333,"connectStart":333,"domainLookupEnd":333,"domainLookupStart":333,"fetchStart":333,"redirectEnd":0,"redirectStart":0,"requestStart":333,"responseEnd":1863.5,"responseStart":1863.5,"secureConnectionStart":333},{"duration":200.5,"initiatorType":"xmlhttprequest","name":"https://jira.mariadb.org/rest/webResources/1.0/resources","startTime":1207.8999996185303,"connectEnd":1207.8999996185303,"connectStart":1207.8999996185303,"domainLookupEnd":1207.8999996185303,"domainLookupStart":1207.8999996185303,"fetchStart":1207.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1207.8999996185303,"responseEnd":1408.3999996185303,"responseStart":1408.3999996185303,"secureConnectionStart":1207.8999996185303},{"duration":409.19999980926514,"initiatorType":"link","name":"https://jira.mariadb.org/s/d5715adaadd168a9002b108b2b039b50-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/css/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1484.8999996185303,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1484.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1894.0999994277954,"responseStart":0,"secureConnectionStart":0},{"duration":396.80000019073486,"initiatorType":"script","name":"https://jira.mariadb.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/lu2cib/820016/12ta74/e65b778d185daf5aee24936755b43da6/_/download/contextbatch/js/browser-metrics-plugin.contrib,-_super,-project.issue.navigator,-jira.view.issue,-atl.general/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&slack-enabled=true","startTime":1485.7999992370605,"connectEnd":1485.7999992370605,"connectStart":1485.7999992370605,"domainLookupEnd":1485.7999992370605,"domainLookupStart":1485.7999992370605,"fetchStart":1485.7999992370605,"redirectEnd":0,"redirectStart":0,"requestStart":1485.7999992370605,"responseEnd":1882.5999994277954,"responseStart":1882.5999994277954,"secureConnectionStart":1485.7999992370605},{"duration":401.0999994277954,"initiatorType":"script","name":"https://jira.mariadb.org/s/097ae97cb8fbec7d6ea4bbb1f26955b9-CDN/lu2cib/820016/12ta74/be4b45e9cec53099498fa61c8b7acba4/_/download/contextbatch/js/jira.project.sidebar,-_super,-project.issue.navigator,-jira.general,-jira.browse.project,-jira.view.issue,-jira.global,-atl.general,-com.atlassian.jira.projects.sidebar.init/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en&slack-enabled=true","startTime":1486.1999998092651,"connectEnd":1486.1999998092651,"connectStart":1486.1999998092651,"domainLookupEnd":1486.1999998092651,"domainLookupStart":1486.1999998092651,"fetchStart":1486.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":1486.1999998092651,"responseEnd":1887.2999992370605,"responseStart":1887.2999992370605,"secureConnectionStart":1486.1999998092651},{"duration":415,"initiatorType":"script","name":"https://www.google-analytics.com/analytics.js","startTime":1528.1999998092651,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":1528.1999998092651,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":1943.1999998092651,"responseStart":0,"secureConnectionStart":0}],"fetchStart":0,"domainLookupStart":0,"domainLookupEnd":0,"connectStart":0,"connectEnd":0,"requestStart":72,"responseStart":319,"responseEnd":331,"domLoading":323,"domInteractive":1946,"domContentLoadedEventStart":1946,"domContentLoadedEventEnd":1998,"domComplete":2257,"loadEventStart":2257,"loadEventEnd":2257,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[{"name":"bigPipe.sidebar-id.start","time":1865.1999998092651},{"name":"bigPipe.sidebar-id.end","time":1866.0999994277954},{"name":"bigPipe.activity-panel-pipe-id.start","time":1866.1999998092651},{"name":"bigPipe.activity-panel-pipe-id.end","time":1871.2999992370605},{"name":"activityTabFullyLoaded","time":2023.6999998092651}],"measures":[],"correlationId":"317a88e539f1df","effectiveType":"4g","downlink":9.6,"rtt":0,"serverDuration":189,"dbReadsTimeInMs":22,"dbConnsTimeInMs":33,"applicationHash":"9d11dbea5f4be3d4cc21f03a88dd11d8c8687422","experiments":[]}}
My config file:
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# This group is read both both by the client and the server
# use it for options that affect everything
#
[client-server]
#
# These groups are read by MariaDB server.
# Use it for options that only the server (but not clients) should see
#
# See the examples of server my.cnf files in /usr/share/mysql/
#
# this is read by the standalone daemon and embedded servers
[server]
tmpdir = /var/lib/mysql/tmpdir
# Disable binary logs, since we don't have replication running here
#log-bin = binlog
#binlog_format = mixed
server_id = 1
#log-basename = server1
expire-logs-days = 7
# this is only for the mysqld standalone daemon
[mysqld]
transaction-isolation = READ-COMMITTED
ignore_db_dirs=lost+found
performance-schema=on
# Set host name for reports
report_host = '172.16.14.241'
default_time_zone='America/Chicago'
# Set default character set and collation
character_set_server = 'latin1'
collation-server = 'latin1_bin'
max_allowed_packet = 512M
# Corresponding value for replication
slave_max_allowed_packet = 512M
# log file location
log_error=/var/log/mysqld.log
# directory for the data
datadir=/var/lib/mysql/
# Max number of opened connections
max_connections=500
# Perf tuning
thread_cache_size=512
# Increased from the default value to handle large number of tables
table_open_cache=30000
# Max number of open files. It has to correlate to an OS change
open_files_limit = 102400
# INNODB OPTIONS
# Buffer Pool Size - (IMPORTANT - DEPENDS on MEMORY!!! - 70 to 80% of memory is recommended)
#innodb_buffer_pool_size = 4G
# Use one file per table in the schema
innodb_file_per_table=1
# lock timeout
innodb_lock_wait_timeout = 300
# Perf improvement to decrease flushing
innodb_log_file_size=512M
# Decreases I/O to disk for larger transaction
innodb_log_buffer_size=64M
innodb_buffer_pool_instances=16
innodb_log_files_in_group=2
# Recommended twice CPUs plus number of disks
innodb_thread_concurrency=10
# Next 2 Recommended to ensure data consistency
innodb_flush_method = O_DIRECT
innodb_doublewrite=1
## Avoid statistics update when doing some ops, e.g. show tables
innodb_stats_on_metadata=0
default_storage_engine=innodb