# Performance\_schema recreation

**URL:** <https://forums.percona.com/t/performance-schema-recreation/24840>\
**Category:** Percona XtraDB Cluster 5.x\
**Tags:** percona\
**Created:** [August 31, 2023, 11:24am UTC](https://forums.percona.com/t/performance-schema-recreation/24840 "2023-08-31T11:24:12Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [August 31, 2023, 11:24am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/1 "2023-08-31T11:24:12Z")

</div>

Hello,

I had some issue on my two node percona 5.7 cluster and after the restart I started to get issues like performance\_schema.variables has structure issue. I tried to recreate the the performance schema by disabling and enabling performance\_schema in my.cnf and remove the folder performance\_schema but it did not work. Now i want to recreate performance\_schema to make sure the structure in performance\_schema DB is recreated without issues. Please give your suggestion.

Thanks,  
Shahid.

---

<div class="post-metadata">

**Author:** ![kedarpercona](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kedarpercona/32/809_2.png) [@kedarpercona](https://forums.percona.com/u/kedarpercona)\
**Post date:** [August 31, 2023, 11:40am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/2 "2023-08-31T11:40:50Z")

</div>

quick thinking… did you recently upgrade and missed mysql\_upgrade?

---

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [August 31, 2023, 11:44am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/3 "2023-08-31T11:44:09Z")

</div>

Kedarpercona,

I think your are right… there was a minor update on the system that yum initiated. Can you tell me will my tables be locked if I run mysql\_upgrade ? I have large database and cant keep it down for long time.

Thanks.

---

<div class="post-metadata">

**Author:** ![kedarpercona](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kedarpercona/32/809_2.png) [@kedarpercona](https://forums.percona.com/u/kedarpercona)\
**Post date:** [August 31, 2023, 12:08pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/4 "2023-08-31T12:08:32Z")

</div>

I’d not really run other things while i’m performing mysql\_upgrdae. Perform that and restart as it will change P\_S / I\_S tables

---

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [August 31, 2023, 1:26pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/5 "2023-08-31T13:26:46Z")

</div>

I will need to run mysql\_upgrade on one of my data nodes or I will need to run it on both nodes ? and do i have to stop one node while i am running mysql\_upgrade on other machine ?

---

<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 31, 2023, 2:44pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/6 "2023-08-31T14:44:10Z")

</div>

@shahidbashir7861,  
You can run `mysql_upgrade` on both nodes, it will not hurt anything if it runs twice. You do not need to stop any nodes, but you will need to restart each node after running mysql\_upgrade.

---

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [September 1, 2023, 11:02am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/7 "2023-09-01T11:02:32Z")

</div>

Mattthewb, Thanks for the response. I try plan accordingly.

I am trying to take the dump of all the DBs before I do mysql\_upgrade but I am getting the following error.

mysqldump: Couldn’t execute ‘SELECT COUNT(\*) FROM performance\_schema.session\_variables WHERE VARIABLE\_NAME LIKE ‘rocksdb\_skip\_fill\_cache’’: Native table ‘performance\_schema’.‘session\_variables’ has the wrong structure (1682)

Is there some workaround for this ? because i need to do backups before I could run mysql\_upgrade.

Thanks.

---

<div class="post-metadata">

**Author:** ![kedarpercona](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/kedarpercona/32/809_2.png) [@kedarpercona](https://forums.percona.com/u/kedarpercona)\
**Post date:** [September 1, 2023, 11:07am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/8 "2023-09-01T11:07:52Z")

</div>

Hi @shahidbashir7861

You don’t need to dump those databases… I\_S/P\_S/sys…

Thanks,  
K

---

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [September 1, 2023, 12:32pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/9 "2023-09-01T12:32:21Z")

</div>

Hello Kedar,

I am not taking dump of information\_schema or performance\_schema. The error shows up when I try to take dump of any database on the server using mysqldump command. Also, the file level back using innobackupex is also failing as it also tries to read some variables from peformance\_schema before it starts the backup.

Thanks,  
Shahid.

---

<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:** [September 1, 2023, 2:09pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/10 "2023-09-01T14:09:34Z")

</div>

@shahidbashir7861,  
You need to run mysql\_upgrade first. You can’t do anything else, backup included, until you do this. `mysql_upgrade` does not modify any data or touch any non-system tables. You are safe to run this command now.

---

<div class="post-metadata">

**Author:** ![shahidbashir7861](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/shahidbashir7861/32/4908_2.png) [@shahidbashir7861](https://forums.percona.com/u/shahidbashir7861)\
**Post date:** [September 12, 2023, 11:07am UTC](https://forums.percona.com/t/performance-schema-recreation/24840/11 "2023-09-12T11:07:19Z")

</div>

Hello Matthewb,

mysql\_upgrade worked without any issue on my system and all the operations were recovered. Thanks for the help

One thing, I noticed that mysql\_upgrade kind of checking all the tables in all the DBs when i was testing the command on some of our Dev servers. As you said it wont touch any non system tables, I just wanted to let you know and check why it would do so.

Thanks,  
Shahid.

---

<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:** [September 12, 2023, 12:38pm UTC](https://forums.percona.com/t/performance-schema-recreation/24840/12 "2023-09-12T12:38:45Z")

</div>

Yes, it checks non-system tables for issues but it does not rebuild them. That’s what I meant. System tables will automatically get rebuilt/fixed, but non-system tables will still get checked. It is a non-locking/non-blocking check; nothing to worry about.
