Bug #118590 Trigger not restored and util.loadDump() fails with MySQLSH 2013 during restoration using MySQL Kubernetes Operator
Submitted: 7 Jul 9:22 Modified: 7 Jul 14:52
Reporter: rahul chaudhari Email Updates:
Status: Analyzing Impact on me:
None 
Category:MySQL Operator Severity:S2 (Serious)
Version:MySQL 8.0.35 OS:Linux (Tested on Kubernetes v1.26+ with standard InnoDBCluster CRD.)
Assigned to: MySQL Verification Team CPU Architecture:Any
Tags: kubernetes, mysql-operator, mysqlsh, trigger-missing, util.loadDump

[7 Jul 9:22] rahul chaudhari
Description:
While restoring a database using util.loadDump() through MySQL Kubernetes Operator (Oracle MySQL Operator), the restoration process mostly completes, but:

MySQL triggers are not restored.

util.loadDump() fails with the error:
MySQLSH 2013: Lost connection to MySQL server during query

we have apply this configuration:
log_bin_trust_function_creators=1
sql-mode=ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION
cte_max_recursion_depth=10000
group_concat_max_len=1000000
innodb_print_all_deadlocks=1
transaction_isolation=READ-COMMITTED
lower_case_table_names=1
max_allowed_packet = 1G
innodb_buffer_pool_size = 4G
net_read_timeout = 6000
net_write_timeout = 6000
wait_timeout = 28800
max_allowed_packet = 512M
net_read_timeout = 600
net_write_timeout = 600
wait_timeout = 28800
interactive_timeout = 28800
 

How to repeat:
Deploy MySQL Operator using:
kubectl apply -f https://raw.githubusercontent.com/mysql/mysql-operator/9.3.0-2.2.4/deploy/deploy-operator....

Set up InnoDBCluster (example spec shared below in private comment).

Perform restore using:
util.loadDump("/mysql-restore/MySQL/database", {
  threads: 4,
  progressFile: "/mysql-restore/MySQL/progress.log",
  maxBytesPerTransaction: "128M"
})
Observe that:

Triggers are missing after restore.

Process fails during index creation with Lost connection error.

Suggested fix:
Validate if util.loadDump() under operator supports full trigger restoration or if additional steps are needed.
- I don’t know the fix. Please check and verify it.