Page MenuHomePhabricator

ToolsDB: discard obsolete GTID domains
Open, Stalled, Needs TriagePublic

Description

The GTID in the ToolsDB servers (tools-db-1 and tools-db-2) contains two obsolete domain ids that can be safely discarded as explained at https://mariadb.com/kb/en/gtid/#deleting-unused-domains

Domain id 0 is from an old server that was deleted years ago and can be discarded.

Domain id 2886731673 was the id used by clouddb1001 before it was shut down in T333471, and can also be discarded.

2886731301 is the id of tools-db-1 and the one we want to keep because it's the one currently being used for replicating from tools-db-1 to tools-db-2.

//tools-db-1

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%';
+-------------------------+-------------------------------------------------------------------------------------------+
| Variable_name           | Value                                                                                     |
+-------------------------+-------------------------------------------------------------------------------------------+
| gtid_binlog_pos         | 2886731301-2886731301-143124522,2886731673-2886731673-4887243158                          |
| gtid_binlog_state       | 2886731301-2886731301-143124522,2886731673-2886731673-4887243158                          |
| gtid_cleanup_batch_size | 64                                                                                        |
| gtid_current_pos        | 0-2886731673-33522724637,2886731301-2886731301-143124522,2886731673-2886731673-4887243158 |
| gtid_domain_id          | 2886731301                                                                                |
| gtid_ignore_duplicates  | OFF                                                                                       |
| gtid_pos_auto_engines   |                                                                                           |
| gtid_slave_pos          | 0-2886731673-33522724637,2886731673-2886731673-4887243158                                 |
| gtid_strict_mode        | OFF                                                                                       |
+-------------------------+-------------------------------------------------------------------------------------------+

//tools-db-2

MariaDB [(none)]> SHOW GLOBAL VARIABLES LIKE 'gtid%';
+-------------------------+-------------------------------------------------------------------------------------------+
| Variable_name           | Value                                                                                     |
+-------------------------+-------------------------------------------------------------------------------------------+
| gtid_binlog_pos         | 2886731301-2886731301-143124674,2886731673-2886731673-4887243158                          |
| gtid_binlog_state       | 2886731301-2886731301-143124674,2886731673-2886731673-4887243158                          |
| gtid_cleanup_batch_size | 64                                                                                        |
| gtid_current_pos        | 0-2886731673-33522724637,2886731301-2886731301-143124674,2886731673-2886731673-4887243158 |
| gtid_domain_id          | 2886730873                                                                                |
| gtid_ignore_duplicates  | OFF                                                                                       |
| gtid_pos_auto_engines   |                                                                                           |
| gtid_slave_pos          | 0-2886731673-33522724637,2886731301-2886731301-143124674,2886731673-2886731673-4887243158 |
| gtid_strict_mode        | OFF                                                                                       |
+-------------------------+-------------------------------------------------------------------------------------------+

Event Timeline

fnegri updated the task description. (Show Details)

My plan is to run on both tools-db-1 (primary) and tools-db-2 (secondary):

FLUSH BINARY LOGS DELETE_DOMAIN_ID=(0,2886731673);

From the documentation, it looks like I will also have to manually update gtid_slave_pos in tools-db-2 (secondary):

SET gtid_slave_pos="<position with domains removed>"`

And probably also clear gtid_slave_pos in tools-db-1 (primary) as it's no longer replicating from other servers.

SET GLOBAL gtid_slave_pos = '';
fnegri changed the task status from Open to Stalled.Apr 18 2023, 4:02 PM
fnegri added subscribers: Marostegui, jcrespo.

After speaking with @Marostegui and @jcrespo, I'm postponing this for now as they experienced a few issues while trying to do the same thing in other servers. I'm linking this to T324965 that is tracking similar clean-up operations.