# Gcache files deletion

**URL:** <https://forums.percona.com/t/gcache-files-deletion/37393>\
**Category:** MySQL & MariaDB\
**Tags:** mysql\
**Created:** [March 27, 2025, 4:56pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393 "2025-03-27T16:56:29Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![engineer2024](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/engineer2024/32/20597_2.png) [@engineer2024](https://forums.percona.com/u/engineer2024)\
**Post date:** [March 27, 2025, 4:56pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/1 "2025-03-27T16:56:29Z")

</div>

We have a 3 node galera cluster with mariadb server version

mariadb-server 1:10.11.2+maria~ubu2004 amd64 MariaDB database server binaries

The wsrep version is 26.4.14 , wsrep\_provider\_name is galera. We are observing lot of gcache files from 4 months ago . can we safely delete those old files ? if so, how much older files can be deleted ? The wsrep\_local\_state\_comment is showing as synced

---

<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:** [March 27, 2025, 5:46pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/2 "2025-03-27T17:46:24Z")

</div>

Those should be auto-purging. What do you have configured for `wsrep_provider_options`? Do you have `gcache.freeze_purge_at_seqno` enabled?

---

<div class="post-metadata">

**Author:** ![engineer2024](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/engineer2024/32/20597_2.png) [@engineer2024](https://forums.percona.com/u/engineer2024)\
**Post date:** [March 27, 2025, 5:51pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/3 "2025-03-27T17:51:59Z")

</div>

> [@matthewb](#):
>
> gcache.freeze\_purge\_at\_seqno

Is it a config option for galera ? Also we have files from last 4 months. can we delete those ? what is the test to decide which onces to delete

---

<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:** [March 27, 2025, 6:29pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/4 "2025-03-27T18:29:59Z")

</div>

Yes, config option in wsrep\_provider\_options. The test is looking at the last sequence number and if the current seqno is above that, you can delete.

---

<div class="post-metadata">

**Author:** ![engineer2024](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/engineer2024/32/20597_2.png) [@engineer2024](https://forums.percona.com/u/engineer2024)\
**Post date:** [March 27, 2025, 6:48pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/5 "2025-03-27T18:48:14Z")

</div>

one thing to understand..

so i have a long list of 10k gcache.page files in the /var/lib/mysql folder. how to compare the last seq no with the current one and decide which gcache files have to be deleted ? Please clarify this.

The seq no in grastate.dat is -1 .

---

<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:** [March 27, 2025, 8:14pm UTC](https://forums.percona.com/t/gcache-files-deletion/37393/6 "2025-03-27T20:14:28Z")

</div>

> [@engineer2024](#):
>
> The seq no in grastate.dat is -1

Yes, this is always the case when PXC is running. On shutdown, the value will be updated.

You still have not confirmed your settings. If the settings are wrong, then when corrected, the gcache files will auto-purge.

You can simply stop nodeX, erase all gcache files, then start nodeX back up. This will not cause loss of data. The cache files will start generating again. Repeat for nodeY, then nodeZ.

---

<div class="post-metadata">

**Author:** ![engineer2024](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/engineer2024/32/20597_2.png) [@engineer2024](https://forums.percona.com/u/engineer2024)\
**Post date:** [March 28, 2025, 5:43am UTC](https://forums.percona.com/t/gcache-files-deletion/37393/7 "2025-03-28T05:43:35Z")

</div>

## this is our config

wsrep\_provider\_options = "gcache.size = 1024M; gmcast.listen\_addr = tcp://
