Skip to content

Recycle Bin crash issue #38

Closed
Closed

Description

@ukzz1

Good evening. We encountered an issue in production. We enabled the recycle bin in production, but it crashed when an operator accidentally deleted a database and used the recycle bin function. We found that it seems to crash immediately when restoring more than 20 tables at once. Initially, it worked fine during our tests, probably because we were only testing with a few tables. Below is the process of reproducing the issue.

-- SQL Start --

CREATE DATABASE IF NOT EXISTS sbtest
DEFAULT CHARACTER SET utf8mb4
DEFAULT COLLATE utf8mb4_0900_ai_ci;
USE sbtest;

SET FOREIGN_KEY_CHECKS = 0;

-- sbtest1 ~ sbtest30
CREATE TABLE IF NOT EXISTS sbtest1 (
id INT NOT NULL AUTO_INCREMENT,
k INT NOT NULL DEFAULT 0,
c CHAR(120) NOT NULL DEFAULT '',
pad CHAR(60) NOT NULL DEFAULT '',
PRIMARY KEY (id),
KEY idx_k (k)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;

CREATE TABLE IF NOT EXISTS sbtest2 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest3 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest4 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest5 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest6 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest7 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest8 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest9 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest10 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest11 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest12 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest13 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest14 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest15 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest16 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest17 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest18 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest19 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest20 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest21 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest22 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest23 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest24 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest25 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest26 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest27 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest28 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest29 LIKE sbtest1;
CREATE TABLE IF NOT EXISTS sbtest30 LIKE sbtest1;

SET FOREIGN_KEY_CHECKS = 1;

USE sbtest;

SET FOREIGN_KEY_CHECKS = 0;

DROP TABLE IF EXISTS
sbtest1, sbtest2, sbtest3, sbtest4, sbtest5,
sbtest6, sbtest7, sbtest8, sbtest9, sbtest10,
sbtest11, sbtest12, sbtest13, sbtest14, sbtest15,
sbtest16, sbtest17, sbtest18, sbtest19, sbtest20,
sbtest21, sbtest22, sbtest23, sbtest24, sbtest25,
sbtest26, sbtest27, sbtest28, sbtest29, sbtest30;

SET FOREIGN_KEY_CHECKS = 1;

show recycle_bin;

restore database sbtest from recycle_bin;

-- SQL End --

Image

Activity

  1. ukzz1 commented on Jan 21, 2026

    @ukzz1
    Author

    my.cnf parameters

    [mysqld_safe]
    core-file-size=unlimited

    [mysqld]
    datadir=/opt/mysql/data
    log-error=/opt/mysql/mysqld.log
    pid-file=/opt/mysql/mysqld.pid
    socket=/tmp/mysql.sock

    txsql_recycle_bin_enabled=on
    txsql_recycle_bin_db_not_visible=on
    txsql_recycle_scheduler_interval=86400
    txsql_recycle_bin_retention=604800

    back_log=5000
    binlog_format=row
    binlog_transaction_dependency_history_size=500000
    binlog_transaction_dependency_tracking=WRITESET
    character_set_server=utf8mb4
    collation_server=utf8mb4_0900_ai_ci
    connect_timeout=10
    core_file
    default_authentication_plugin=mysql_native_password
    default_password_lifetime=0
    default_storage_engine=INNODB
    default_time_zone=SYSTEM
    innodb_adaptive_hash_index_parts=16
    innodb_buffer_pool_instances=16
    innodb_buffer_pool_size=16G
    innodb_change_buffer_max_size=25
    innodb_concurrency_tickets=5000
    innodb_doublewrite_pages=64
    innodb_io_capacity=50000
    innodb_io_capacity_max=100000
    innodb_log_buffer_size=1G
    innodb_redo_log_capacity=8G
    innodb_open_files=655360
    innodb_parallel_read_threads=4
    innodb_purge_threads=8
    innodb_read_io_threads=8
    innodb_undo_tablespaces=4
    local_infile=ON
    lower_case_table_names=1
    log-bin
    log_error_verbosity=2
    log_timestamps=system
    max_connect_errors=100
    max_connections=10000
    open_files_limit=1024000
    server-id=10
    skip-name-resolve
    skip-ssl

  2. willhan123 commented on Jun 4, 2026

    @willhan123
    Collaborator

    i fix it later

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions