2

I have a large table (2.3TB of data, 1.9TB index, 33 billion rows). A user recently executed a DELETE statement (32k rows) against the table, which caused the server to eat up all memory and then fail over. The DELETE never finished. Converting the DELETE to SELECT ran in 30 seconds with no adverse effects.

Here's the table schema:

CREATE TABLE `bigtable` (
  `id` bigint(20) unsigned NOT NULL AUTO_INCREMENT,
  `business_unit_id` tinyint(3) unsigned NOT NULL,
  `visitor_id` bigint(20) unsigned NOT NULL,
  `visit_id` bigint(20) unsigned DEFAULT NULL,
  `keyword_id` int(10) unsigned DEFAULT NULL,
  `publisher_id` mediumint(8) unsigned DEFAULT NULL,
  `placement_id` bigint(20) DEFAULT NULL,
  `creative_id` mediumint(8) unsigned DEFAULT NULL,
  `unknown_referer_id` int(10) unsigned DEFAULT NULL,
  `insert_time` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  PRIMARY KEY (`id`,`insert_time`),
  KEY `ix_bigtable_visitor_id` (`business_unit_id`,`visitor_id`)
) ENGINE=InnoDB AUTO_INCREMENT=198936326312 DEFAULT CHARSET=utf8 

There are no triggers or foreign keys. Binlog format is row, and it is being replicated to another Aurora cluster using standard replication.

The delete was of the form:

delete from `bigtable` where id in (large list of values)

What would cause this behavior?

Note: I'm not looking for advice in tuning the table or query. I'm just trying to find out what's happening.

10
  • Sorry to hear :/. That's exactly why I stay away from RDS. Is error log available in RDS - there might be stack trace in there. As a workaround you might want to try pt-archiver. It would delete records by the primary key. Hopefully, RDS will survive that.
    – akuzminsky
    Commented May 25, 2022 at 15:00
  • to clarify. I stay away from RDS not because there is a potential bug - any software has bugs. But because it's nearly impossible to debug. No coredumps, no logs, no way to bpftrace it.
    – akuzminsky
    Commented May 25, 2022 at 15:06
  • About how many rows? 10K should not be a problem. In any case, I would break it up into 100 or 1000 rows at a time; this will eliminate some of the potential issues.
    – Rick James
    Commented May 25, 2022 at 20:55
  • To clarify, it's not really a true "crash". There's nothing in the error log (yes, it is available) to indicate any problems; however, the mysqld process continues to eat up all memory until the host becomes unresponsive, at which point AWS forces a failover. It's 32k rows, as I noted in the OP, and we are having the application devs change their query, but that's not the point of the post.
    – Swechsler
    Commented May 25, 2022 at 22:43
  • Additional information request, please. What is your RDS type? RAM size, # cores, any SSD or NVME devices on MySQL Host server? Post on pastebin.com and share the links. From your SSH login root, Text results of: A) SELECT COUNT(*) FROM information_schema.tables; B) SHOW GLOBAL STATUS; after minimum 24 hours UPTIME C) SHOW GLOBAL VARIABLES; D) SHOW FULL PROCESSLIST; E) STATUS; not SHOW STATUS, just STATUS; G) SHOW ENGINE INNODB STATUS; for server workload tuning analysis to provide suggestions - that will increase DELETE tolerance. Commented May 30, 2022 at 13:01

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.