Comments - Compiling MariaDB for debugging in Ubuntu 16.04

7 years, 2 months ago Nirbhay Choubey

Can you share logs above the following message?

2017-01-23 15:28:02 140700316179200 [Note] Got signal 15 to shutdown mysqld

 
7 years, 2 months ago mrk

Sure.

There were 5816 project related tables, that were all initialized with the following entries:

2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Created tablespace for space 32615 name project_XY/_portal key_id 0 encryption 0.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Read page 0 from tablespace for space 32615 name project_XY/_portal key_id 0 encryption 0 handle 410.

I kicked those entries from the logfile of galera, which is appended next.

2017-01-31 14:19:07 140513410438976 [Note] WSREP: Read nil XID from storage engines, skipping position init
2017-01-31 14:19:07 140513410438976 [Note] WSREP: wsrep_load(): loading provider library '/usr/lib/galera/libgalera_smm.so'
2017-01-31 14:19:07 140513410438976 [Note] WSREP: wsrep_load(): Galera 25.3.19(r3667) by Codership Oy <info@codership.com> loaded successfully.
2017-01-31 14:19:07 140513410438976 [Note] WSREP: CRC-32C: using hardware acceleration.
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Found saved state: 3064cb75-9962-11e3-8c48-a2db611fdfd5:-1, safe_to_bootsrap: 0
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Passing config to GCS: base_dir = /var/lib/mysql/; base_host =  aaa.bbb.ccc.ddd; base_port = 4567; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT15S; evs.join_retrans_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT5S; evs.user_send_window = 2; evs.view_forget_timeout = PT24H; gcache.dir = /var/lib/mysql/; gcache.keep_pages_size = 0; gcache.mem_size = 0; gcache.name = /var/lib/mysql//galera.cache; gcache.page_size = 128M; gcache.recover = no; gcache.size = 8G; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; gcs.recv_q_hard_limit = 9223372036854775807; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; gmcast.segment = 0; gmcast.version = 0; pc.announce_timeout = PT3S; pc.checksum = false; pc.
2017-01-31 14:19:07 140513410438976 [Note] WSREP: GCache history reset: old(3064cb75-9962-11e3-8c48-a2db611fdfd5:0) -> new(3064cb75-9962-11e3-8c48-a2db611fdfd5:1621259828)
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Assign initial position for certification: 1621259828, protocol version: -1
2017-01-31 14:19:07 140513410438976 [Note] WSREP: wsrep_sst_grab()
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Start replication
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Setting initial position to 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621259828
2017-01-31 14:19:07 140513410438976 [Note] WSREP: protonet asio version 0
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Using CRC-32C for message checksums.
2017-01-31 14:19:07 140513410438976 [Note] WSREP: initializing ssl context
2017-01-31 14:19:07 140513410438976 [Note] WSREP: backend: asio
2017-01-31 14:19:07 140513410438976 [Note] WSREP: gcomm thread scheduling priority set to other:0
2017-01-31 14:19:07 140513410438976 [Note] WSREP: restore pc from disk successfully
2017-01-31 14:19:07 140513410438976 [Note] WSREP: GMCast version 0
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') listening at ssl://0.0.0.0:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') multicast: , ttl: 1
2017-01-31 14:19:07 140513410438976 [Note] WSREP: EVS version 0
2017-01-31 14:19:07 140513410438976 [Note] WSREP: gcomm: connecting to group 'CLUSTERNAME', peer 'nodename00.SERVERNAME.de:,nodename01.SERVERNAME.de:,nodename02.SERVERNAME.de:,nodename03.SERVERNAME.de:,nodename04.SERVERNAME.de:,nodename05.SERVERNAME.de:,a2a.b2b.c2c.d2d:'
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl:// aaa.bbb.ccc.ddd:48022 local endpoint ssl:// aaa.bbb.ccc.ddd:4567 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl:// aaa.bbb.ccc.ddd:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:48022 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl://eee.fff.ggg.hhh:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:36016 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl://iii.jjj.kkk.lll:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:46098 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl://mmm.nnn.ooo.ppp:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:56146 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 7308a445 ssl:// aaa.bbb.ccc.ddd:4567
2017-01-31 14:19:07 140513410438976 [Warning] WSREP: (7308a445, 'ssl://0.0.0.0:4567') address 'ssl:// aaa.bbb.ccc.ddd:4567' points to own listening address, blacklisting
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 6c3ebf6b ssl://mmm.nnn.ooo.ppp:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl://uuu.vvv.www.xxx:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:47228 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') turning message relay requesting on, nonlive peers:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 3e21b476 ssl://iii.jjj.kkk.lll:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 88961d1b ssl://eee.fff.ggg.hhh:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: SSL handshake successful, remote endpoint ssl://qqq.rrr.sss.ttt:4567 local endpoint ssl:// aaa.bbb.ccc.ddd:60788 cipher: AES128-SHA compression:
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 99f886d0 ssl://uuu.vvv.www.xxx:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection established to 62ec6ba2 ssl://qqq.rrr.sss.ttt:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: declaring 3e21b476 at ssl://iii.jjj.kkk.lll:4567 stable
2017-01-31 14:19:07 140513410438976 [Note] WSREP: declaring 62ec6ba2 at ssl://qqq.rrr.sss.ttt:4567 stable
2017-01-31 14:19:07 140513410438976 [Note] WSREP: declaring 6c3ebf6b at ssl://mmm.nnn.ooo.ppp:4567 stable
2017-01-31 14:19:07 140513410438976 [Note] WSREP: declaring 88961d1b at ssl://eee.fff.ggg.hhh:4567 stable
2017-01-31 14:19:07 140513410438976 [Note] WSREP: declaring 99f886d0 at ssl://uuu.vvv.www.xxx:4567 stable
2017-01-31 14:19:07 140513410438976 [Note] WSREP: Node 3e21b476 state prim
2017-01-31 14:19:07 140513410438976 [Note] WSREP: view(view_id(PRIM,3e21b476,259) memb {
	3e21b476,0
	62ec6ba2,0
	6c3ebf6b,0
	7308a445,0
	88961d1b,0
	99f886d0,0
} joined {
} left {
} partitioned {
})
2017-01-31 14:19:07 140513410438976 [Note] WSREP: save pc into disk
2017-01-31 14:19:07 140513410438976 [Note] WSREP: discarding pending addr without UUID: ssl://a2a.b2b.c2c.d2d:4567
2017-01-31 14:19:07 140513410438976 [Note] WSREP: clear restored view
2017-01-31 14:19:08 140513410438976 [Note] WSREP: gcomm: connected
2017-01-31 14:19:08 140513410438976 [Note] WSREP: Changing maximum packet size to 64500, resulting msg size: 32636
2017-01-31 14:19:08 140513410438976 [Note] WSREP: Shifting CLOSED -> OPEN (TO: 0)
2017-01-31 14:19:08 140513410438976 [Note] WSREP: Opened channel 'CLUSTERNAME'
2017-01-31 14:19:08 140504058541824 [Note] WSREP: New COMPONENT: primary = yes, bootstrap = no, my_idx = 3, memb_num = 6
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: Waiting for state UUID.
2017-01-31 14:19:08 140513410438976 [Note] WSREP: Waiting for SST to complete.
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: sent state msg: d876f28a-e7b7-11e6-aa94-870429e8d887
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 0 (nodename04)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 1 (nodename01)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 2 (nodename00)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 4 (nodename03)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 5 (nodename02)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: STATE EXCHANGE: got state msg: d876f28a-e7b7-11e6-aa94-870429e8d887 from 3 (nodename05)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Quorum results:
	version    = 4,
	component  = PRIMARY,
	conf_id    = 256,
	members    = 5/6 (joined/total),
	act_id     = 1621274045,
	last_appl. = -1,
	protocols  = 0/7/3 (gcs/repl/appl),
	group UUID = 3064cb75-9962-11e3-8c48-a2db611fdfd5
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Flow-control interval: [39, 39]
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Shifting OPEN -> PRIMARY (TO: 1621274045)
2017-01-31 14:19:08 140512741665536 [Note] WSREP: State transfer required:
	Group state: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621274045
	Local state: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621259828
2017-01-31 14:19:08 140512741665536 [Note] WSREP: New cluster view: global state: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621274045, view# 257: Primary, number of nodes: 6, my index: 3, protocol version 3
2017-01-31 14:19:08 140512741665536 [Warning] WSREP: Gap in state sequence. Need state transfer.
2017-01-31 14:19:08 140504050149120 [Note] WSREP: Running: 'wsrep_sst_xtrabackup-v2 --role 'joiner' --address ' aaa.bbb.ccc.ddd' --datadir '/var/lib/mysql/'   --parent '19785' --binlog '/var/log/mysql/mariadb-bin' '
WSREP_SST: [INFO] Streaming with xbstream (20170131 14:19:08.464)
WSREP_SST: [INFO] Using socat as streamer (20170131 14:19:08.465)
WSREP_SST: [INFO] Evaluating timeout -k 110 100 socat -u TCP-LISTEN:4444,reuseaddr stdio | xbstream -x; RC=( ${PIPESTATUS[@]} ) (20170131 14:19:08.486)
2017-01-31 14:19:08 140512741665536 [Note] WSREP: Prepared SST request: xtrabackup-v2| aaa.bbb.ccc.ddd:4444/xtrabackup_sst//1
2017-01-31 14:19:08 140512741665536 [Note] WSREP: wsrep_notify_cmd is not defined, skipping notification.
2017-01-31 14:19:08 140512741665536 [Note] WSREP: REPL Protocols: 7 (3, 2)
2017-01-31 14:19:08 140512741665536 [Note] WSREP: Assign initial position for certification: 1621274045, protocol version: 3
2017-01-31 14:19:08 140512763090688 [Note] WSREP: Service thread queue flushed.
2017-01-31 14:19:08 140512741665536 [Note] WSREP: IST receiver addr using ssl:// aaa.bbb.ccc.ddd:4568
2017-01-31 14:19:08 140512741665536 [Note] WSREP: IST receiver using ssl
2017-01-31 14:19:08 140512741665536 [Note] WSREP: Prepared IST receiver, listening at: ssl:// aaa.bbb.ccc.ddd:4568
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Member 3.0 (nodename05) requested state transfer from '*any*'. Selected 5.0 (nodename02)(SYNCED) as donor.
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Shifting PRIMARY -> JOINER (TO: 1621274065)
2017-01-31 14:19:08 140512741665536 [Note] WSREP: Requesting state transfer: success, donor: 5
2017-01-31 14:19:08 140512741665536 [Note] WSREP: GCache history reset: old(3064cb75-9962-11e3-8c48-a2db611fdfd5:0) -> new(3064cb75-9962-11e3-8c48-a2db611fdfd5:1621274045)
2017-01-31 14:19:08 140504058541824 [Note] WSREP: 5.0 (nodename02): State transfer to 3.0 (nodename05) complete.
2017-01-31 14:19:08 140504058541824 [Note] WSREP: Member 5.0 (nodename02) synced with group.
WSREP_SST: [INFO] xtrabackup_ist received from donor: Running IST (20170131 14:19:08.970)
WSREP_SST: [INFO] Galera co-ords from recovery: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621259828 0 (20170131 14:19:08.972)
WSREP_SST: [INFO] Total time on joiner: 0 seconds (20170131 14:19:08.976)
WSREP_SST: [INFO] Removing the sst_in_progress file (20170131 14:19:08.978)
2017-01-31 14:19:08 140513410438976 [Note] WSREP: SST complete, seqno: 1621259828
2017-01-31 14:19:09 140513410438976 [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.
2017-01-31 14:19:09 140513410438976 [ERROR] mysqld: file-key-management-filename is not set
2017-01-31 14:19:09 140513410438976 [ERROR] Plugin 'file_key_management' init function returned error.
2017-01-31 14:19:09 140513410438976 [ERROR] Plugin 'file_key_management' registration as a ENCRYPTION failed.
2017-01-31 14:19:09 140513410438976 [Note] CONNECT: Version 1.05.0001 December 13, 2016
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2017-01-31 14:19:09 140513410438976 [Note] InnoDB:  InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
2017-01-31 14:19:09 140513410438976 [Note] InnoDB:  InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: The InnoDB memory heap is disabled
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: GCC builtin __atomic_thread_fence() is used for memory barrier
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Compressed tables use zlib 1.2.8
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Using SSE crc32 instructions
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Initializing buffer pool, size = 8.0G
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Completed initialization of buffer pool
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Created tablespace for space 0 name ./ibdata1 key_id 1 encryption 0.
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Created tablespace for space 4294967280 name ./ib_logfile0 key_id 0 encryption 0.
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Created tablespace for space 4294967281 name arch_log_space key_id 0 encryption 0.
2017-01-31 14:19:09 140513410438976 [Note] InnoDB: Highest supported file format is Barracuda.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Created tablespace for space 24550 name mysql/gtid_slave_pos key_id 0 encryption 0.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Read page 0 from tablespace for space 24550 name mysql/gtid_slave_pos key_id 0 encryption 0 handle 28.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Created tablespace for space 152408 name mysql/innodb_index_stats key_id 0 encryption 0.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Read page 0 from tablespace for space 152408 name mysql/innodb_index_stats key_id 0 encryption 0 handle 30.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Created tablespace for space 152409 name mysql/innodb_table_stats key_id 0 encryption 0.
2017-01-31 14:19:10 140513410438976 [Note] InnoDB: Read page 0 from tablespace for space 152409 name mysql/innodb_table_stats key_id 0 encryption 0 handle 31.
2017-01-31 14:19:11 140504066934528 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') connection to peer 7308a445 with addr ssl:// aaa.bbb.ccc.ddd:4567 timed out, no messages seen in PT3S
2017-01-31 14:19:11 140504066934528 [Note] WSREP: (7308a445, 'ssl://0.0.0.0:4567') turning message relay requesting off
2017-01-31 14:19:23 140513410438976 [Note] InnoDB: 128 rollback segment(s) are active.
2017-01-31 14:19:23 140513410438976 [Note] InnoDB: Waiting for purge to start
2017-01-31 14:19:23 140513410438976 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.34-79.1 started; log sequence number 10347600416363
2017-01-31 14:19:23 140493812971264 [Note] InnoDB: Dumping buffer pool(s) not yet started
2017-01-31 14:19:23 140513410438976 [Note] Plugin 'FEEDBACK' is disabled.
2017-01-31 14:19:23 140513410438976 [Note] Server socket created on IP: ' aaa.bbb.ccc.ddd'.
2017-01-31 14:19:23 140513410438976 [Note] WSREP: Signalling provider to continue.
2017-01-31 14:19:23 140513410438976 [Note] WSREP: SST received: 3064cb75-9962-11e3-8c48-a2db611fdfd5:1621259828
2017-01-31 14:19:23 140512741665536 [Note] WSREP: Receiving IST: 14217 writesets, seqnos 1621259828-1621274045
2017-01-31 14:19:23 140513410438976 [Note] Reading of all Master_info entries succeded
2017-01-31 14:19:23 140513410438976 [Note] Added new Master_info '' to hash table
2017-01-31 14:19:23 140513410438976 [Note] /usr/sbin/mysqld: ready for connections.
Version: '10.1.21-MariaDB-debug'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  Source distribution
2017-01-31 14:20:37 140493764909824 [Note] Got signal 15 to shutdown mysqld
2017-01-31 14:20:37 140493763697408 [Note] /usr/sbin/mysqld: Normal shutdown

2017-01-31 14:20:37 140493763697408 [Note] WSREP: Stop replication
2017-01-31 14:20:37 140493763697408 [Note] WSREP: Closing send monitor...
2017-01-31 14:20:37 140493763697408 [Note] WSREP: Closed send monitor.
2017-01-31 14:20:37 140493763697408 [Note] WSREP: gcomm: terminating thread
2017-01-31 14:20:37 140493763697408 [Note] WSREP: gcomm: joining thread
2017-01-31 14:20:37 140493763697408 [Note] WSREP: gcomm: closing backend
2017-01-31 14:20:37 140493763697408 [Note] WSREP: view(view_id(NON_PRIM,3e21b476,259) memb {
	7308a445,0
} joined {
} left {
} partitioned {
	3e21b476,0
	62ec6ba2,0
	6c3ebf6b,0
	88961d1b,0
	99f886d0,0
})
2017-01-31 14:20:37 140493763697408 [Note] WSREP: view((empty))
2017-01-31 14:20:37 140493763697408 [Note] WSREP: gcomm: closed
2017-01-31 14:20:37 140504058541824 [Note] WSREP: New COMPONENT: primary = no, bootstrap = no, my_idx = 0, memb_num = 1
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Flow-control interval: [16, 16]
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Received NON-PRIMARY.
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Shifting JOINER -> OPEN (TO: 1621276992)
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Received self-leave message.
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Flow-control interval: [0, 0]
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Received SELF-LEAVE. Closing connection.
2017-01-31 14:20:37 140504058541824 [Note] WSREP: Shifting OPEN -> CLOSED (TO: 1621276992)
2017-01-31 14:20:37 140504058541824 [Note] WSREP: RECV thread exiting 0: Success
2017-01-31 14:20:37 140493763697408 [Note] WSREP: recv_thread() joined.
2017-01-31 14:20:37 140493763697408 [Note] WSREP: Closing replication queue.
2017-01-31 14:20:37 140493763697408 [Note] WSREP: Closing slave action queue.
 
7 years, 2 months ago Nirbhay Choubey

It looks like an external script/command sent SIGTERM to the server ("Normal shutdown"). Do you happen to know if there's any script/command that could be shutting down the server?

 
7 years, 2 months ago mrk

Both binaries (standard and debug version) are started via the default start-script that ships with ubuntu 16.04

#!/bin/bash
#
### BEGIN INIT INFO
# Provides:          mysql
# Required-Start:    $remote_fs $syslog
# Required-Stop:     $remote_fs $syslog
# Should-Start:      $network $named $time
# Should-Stop:       $network $named $time
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Start and stop the mysql database server daemon
# Description:       Controls the main MariaDB database server daemon "mysqld"
#                    and its wrapper script "mysqld_safe".
### END INIT INFO
#
set -e
set -u
${DEBIAN_SCRIPT_DEBUG:+ set -v -x}

test -x /usr/sbin/mysqld || exit 0

. /lib/lsb/init-functions

SELF=$(cd $(dirname $0); pwd -P)/$(basename $0)
CONF=/etc/mysql/my.cnf
MYADMIN="/usr/bin/mysqladmin --defaults-file=/etc/mysql/debian.cnf"

# priority can be overriden and "-s" adds output to stderr
ERR_LOGGER="logger -p daemon.err -t /etc/init.d/mysql -i"

# Safeguard (relative paths, core dumps..)
cd /
umask 077

# mysqladmin likes to read /root/.my.cnf. This is usually not what I want
# as many admins e.g. only store a password without a username there and
# so break my scripts.
export HOME=/etc/mysql/

# Source default config file.
[ -r /etc/default/mariadb ] && . /etc/default/mariadb

## Fetch a particular option from mysql's invocation.
#
# Usage: void mysqld_get_param option
mysqld_get_param() {
	/usr/sbin/mysqld --print-defaults \
		| tr " " "\n" \
		| grep -- "--$1" \
		| tail -n 1 \
		| cut -d= -f2
}

## Do some sanity checks before even trying to start mysqld.
sanity_checks() {
  # check for config file
  if [ ! -r /etc/mysql/my.cnf ]; then
    log_warning_msg "$0: WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz"
    echo                "WARNING: /etc/mysql/my.cnf cannot be read. See README.Debian.gz" | $ERR_LOGGER
  fi

  # check for diskspace shortage
  datadir=`mysqld_get_param datadir`
  if LC_ALL=C BLOCKSIZE= df --portability $datadir/. | tail -n 1 | awk '{ exit ($4>4096) }'; then
    log_failure_msg "$0: ERROR: The partition with $datadir is too full!"
    echo                "ERROR: The partition with $datadir is too full!" | $ERR_LOGGER
    exit 1
  fi
}

## Checks if there is a server running and if so if it is accessible.
#
# check_alive insists on a pingable server
# check_dead also fails if there is a lost mysqld in the process list
#
# Usage: boolean mysqld_status [check_alive|check_dead] [warn|nowarn]
mysqld_status () {
    ping_output=`$MYADMIN ping 2>&1`; ping_alive=$(( ! $? ))

    ps_alive=0
    pidfile=`mysqld_get_param pid-file`
    if [ -f "$pidfile" ] && ps `cat $pidfile` >/dev/null 2>&1; then ps_alive=1; fi
    
    if [ "$1" = "check_alive"  -a  $ping_alive = 1 ] ||
       [ "$1" = "check_dead"   -a  $ping_alive = 0  -a  $ps_alive = 0 ]; then
	return 0 # EXIT_SUCCESS
    else
  	if [ "$2" = "warn" ]; then
  	    echo -e "$ps_alive processes alive and '$MYADMIN ping' resulted in\n$ping_output\n" | $ERR_LOGGER -p daemon.debug
	fi
  	return 1 # EXIT_FAILURE
    fi
}

#
# main()
#

case "${1:-''}" in
  'start')
	sanity_checks;
	# Start daemon
	log_daemon_msg "Starting MariaDB database server" "mysqld"
	if mysqld_status check_alive nowarn; then
	   log_progress_msg "already running"
	   log_end_msg 0
	else
	    # Could be removed during boot
	    test -e /var/run/mysqld || install -m 755 -o mysql -g root -d /var/run/mysqld

	    # Start MariaDB! 
  	    /usr/bin/mysqld_safe "${@:2}" > /dev/null 2>&1 &

	    # 6s was reported in #352070 to be too little
	    for i in $(seq 1 "${MYSQLD_STARTUP_TIMEOUT:-60}"); do
                sleep 1
	        if mysqld_status check_alive nowarn ; then break; fi
		log_progress_msg "."
	    done
	    if mysqld_status check_alive warn; then
                log_end_msg 0
	        # Now start mysqlcheck or whatever the admin wants.
	        output=$(/etc/mysql/debian-start)
		[ -n "$output" ] && log_action_msg "$output"
	    else
	        log_end_msg 1
		log_failure_msg "Please take a look at the syslog"
	    fi
	fi
	;;

  'stop')
	# * As a passwordless mysqladmin (e.g. via ~/.my.cnf) must be possible
	# at least for cron, we can rely on it here, too. (although we have 
	# to specify it explicit as e.g. sudo environments points to the normal
	# users home and not /root)
	log_daemon_msg "Stopping MariaDB database server" "mysqld"
	if ! mysqld_status check_dead nowarn; then
	  set +e
	  shutdown_out=`$MYADMIN shutdown 2>&1`; r=$?
	  set -e
	  if [ "$r" -ne 0 ]; then
	    log_end_msg 1
	    [ "$VERBOSE" != "no" ] && log_failure_msg "Error: $shutdown_out"
	    log_daemon_msg "Killing MariaDB database server by signal" "mysqld"
	    killall -15 mysqld
            server_down=
	    for i in `seq 1 600`; do
              sleep 1
              if mysqld_status check_dead nowarn; then server_down=1; break; fi
            done
          if test -z "$server_down"; then killall -9 mysqld; fi
	  fi
        fi

        if ! mysqld_status check_dead warn; then
	  log_end_msg 1
	  log_failure_msg "Please stop MariaDB manually and read /usr/share/doc/mariadb-server-10.1/README.Debian.gz!"
	  exit -1
	else
	  log_end_msg 0
        fi
	;;

  'restart')
	set +e; $SELF stop; set -e
	$SELF start 
	;;

  'reload'|'force-reload')
  	log_daemon_msg "Reloading MariaDB database server" "mysqld"
	$MYADMIN reload
	log_end_msg 0
	;;

  'status')
	if mysqld_status check_alive nowarn; then
	  log_action_msg "$($MYADMIN version)"
	else
	  log_action_msg "MariaDB is stopped."
	  exit 3
	fi
  	;;

  'bootstrap')
	# Bootstrap the cluster, start the first node
	# that initiates the cluster
	log_daemon_msg "Bootstrapping the cluster" "mysqld"
	$SELF start "${@:2}" --wsrep-new-cluster
	;;

  *)
	echo "Usage: $SELF start|stop|restart|reload|force-reload|status|bootstrap"
	exit 1
	;;
esac

For my intension, there is no SIGTERM sending code snippet during the startup.

 
Content reproduced on this site is the property of its respective owners, and this content is not reviewed in advance by MariaDB. The views, information and opinions expressed by this content do not necessarily represent those of MariaDB or any other party.