# How to interrupt xtrabackup related innodb table import?

**URL:** <https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448>\
**Category:** Uncategorized\
**Created:** [August 20, 2024, 7:16am UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448 "2024-08-20T07:16:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Jacob\_Lukose](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jacob_lukose/32/17724_2.png) [@Jacob\_Lukose](https://forums.percona.com/u/Jacob_Lukose)\
**Post date:** [August 20, 2024, 7:16am UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/1 "2024-08-20T07:16:13Z")

</div>

Hi,

We are using xtrabackup to backup and restore our database. During restore phase, we use xtrabackup to restore the database, table by table. For each table, an alter table… import tablespace command is called to load the data. However, sometimes the table .ibd file are huge and it takes considerable amount of time, for import tablespace command to finish. During table import, if there is a need shutdown the server, will it cause corruption for ibd files? I would like to understand if there are standard ways to gracefully interrupt an import tablespace operation without any corruptions. If not, would like to know if import tablespace operation is atomic and if so, can a force kill be done to interrupt, without any corruptions to actual data?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 20, 2024, 4:59pm UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/2 "2024-08-20T16:59:46Z")

</div>

> [@Jacob\_Lukose](#):
>
> During table import, if there is a need shutdown the server, will it cause corruption for ibd files?

In MySQL 8, most DDL operations are _supposed_ to be atomic. Shutting down MySQL during an InnoDB import tablespace sounds dangerous, and would be unsupported.

> [@Jacob\_Lukose](#):
>
> I would like to understand if there are standard ways to gracefully interrupt an import tablespace operation without any corruptions.

I would use the typical ctrl-c to cancel the ALTER TABLE IMPORT.

---

<div class="post-metadata">

**Author:** ![Jacob\_Lukose](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jacob_lukose/32/17724_2.png) [@Jacob\_Lukose](https://forums.percona.com/u/Jacob_Lukose)\
**Post date:** [August 21, 2024, 1:48am UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/3 "2024-08-21T01:48:37Z")

</div>

Thanks for replying, currently we are using Mysql5.7 and not yet migrated to Mysql8. Import happens programatically via the application code, sigint(ctrl+c) could be sent, but not sure if it will be honoured give the whole operation seems atomic. Do we know if doing a sigkill corrupts the ibd data?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 21, 2024, 3:14am UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/4 "2024-08-21T03:14:39Z")

</div>

You would certainly be in a strange/unstable state as part of the pages will have been recorded into the innodb system dictionary, but not all of them if you were to just sigkill mysql.

---

<div class="post-metadata">

**Author:** ![Jacob\_Lukose](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/jacob_lukose/32/17724_2.png) [@Jacob\_Lukose](https://forums.percona.com/u/Jacob_Lukose)\
**Post date:** [August 21, 2024, 3:42am UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/5 "2024-08-21T03:42:17Z")

</div>

okay, is there a way to clean up the innodb system dictionary for the partial pages entered before reattempting import?

---

<div class="post-metadata">

**Author:** ![matthewb](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/matthewb/32/34_2.png) [@matthewb](https://forums.percona.com/u/matthewb)\
**Post date:** [August 21, 2024, 3:50pm UTC](https://forums.percona.com/t/how-to-interrupt-xtrabackup-related-innodb-table-import/32448/6 "2024-08-21T15:50:29Z")

</div>

Not that I am aware of. The internals of InnoDB are not exposed to users. In 5.7, you might be able to DROP TABLE, but InnoDB may tell you the table does not exist even though there is a .ibd file on the disk.  
Your best option is to rethink this process to something more stable and more easily to recover from. Tools like mydumper allow you to take logical snapshots and restore single tables.
