Hi everyone,
I’m currently using an environment with an older Percona 5.7 cluster, and I’m facing the challenge of needing to drop a very large table—approximately 3.5 TB. To minimize impact, I’m planning to use pt-archiver to clean up the table in small batches.
However, there’s an additional complication: the developers have enabled row-based binary logging in this cluster. If I’m not wrong this might significantly increase the volume of binlogs generated.
I noticed that pt-archiver has a DSN option that, if set to true, disables binary logging with SQL_LOG_BIN. Would using this option effectively prevent the cleanup from generating excessive binlogs? Or is there a more efficient approach that I might have overlooked?
Yes it would. SQL_LOG_BIN=0 is a session variable. pt-archiver will set this session variable at the start and it will only affect pt-archiver. Other sessions/connections will continue to get binlog’d as usual.
Keep in mind too that disabling binlogs means if there are any replicas, these rows will not get deleted from any replicas. If you are using the --purge option in pt-archiver, the binlog entry for the deletes should be small and not cause too much bloat. You can monitor how much binlog space you are using and PURGE BINARY LOGS TO ... to clean up excessive binlogs.
Thank you so much for your feedback.
I tested the option you suggested, but it seems it’s not working as expected, or I may have made a mistake in the process. Here’s what I did:
I started the archiver with a Kubernetes job using the following options:
#240823 10:00:04 server id 1 end_log_pos 47430607 CRC32 0x009a9f08 Table_map: `basedb`.`ftp_send_log` mapped to number 890
#240823 10:00:04 server id 1 end_log_pos 47431233 CRC32 0x192e2dbf Delete_rows: table id 890 flags: STMT_END_F
#240823 10:00:04 server id 1 end_log_pos 47431351 CRC32 0xe722146f Table_map: `basedb`.`ftp_send_log` mapped to number 890
#240823 10:00:04 server id 1 end_log_pos 47431977 CRC32 0xe0cea8d5 Delete_rows: table id 890 flags: STMT_END_F
Using b=1 to b=true doesn’t make a difference.
Do you have any suggestions on what might be going wrong?