# Does super\_read\_only works with XtraDB?

**URL:** <https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563>\
**Category:** Percona XtraDB Cluster\
**Tags:** mysql, percona\
**Created:** [February 25, 2022, 11:44am UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563 "2022-02-25T11:44:06Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![katajistok](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@katajistok](https://forums.percona.com/u/katajistok)\
**Post date:** [February 25, 2022, 11:44am UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/1 "2022-02-25T11:44:07Z")

</div>

Hello,

We have this asyncronous replication configured between “standalone” database and XtraDB cluster. Is it possible to use “super\_read\_only” with XtraDB cluster to prevent accidental writes on XtraDB?

Thanks.

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [February 25, 2022, 3:12pm UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/2 "2022-02-25T15:12:28Z")

</div>

Hi @katajistok , thanks for posting to the Percona forums!

Usage of `super_read_only` is an additional protection above `read_only` so that even if you have client accounts granted the `SUPER` privilege, you will be able to block them from accidentally writing to the Replica.

Replication from your asynchronous standalone + PXC will still be applied, the replication thread processes are not blocked by `read_only` or `super_read_only`.

[https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar\_super\_read\_only](https://dev.mysql.com/doc/refman/8.0/en/server-system-variables.html#sysvar_super_read_only)

> **[super-read-only option](https://www.percona.com/doc/percona-server/5.6/management/super_read_only.html)**
>
> super-read-only option

---

<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:** [February 25, 2022, 4:12pm UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/3 "2022-02-25T16:12:50Z")

</div>

> [@katajistok](#):
>
> it possible to use “super\_read\_only” with XtraDB cluster to prevent accidental writes on XtraDB?

Yes. As Michael said, only replication will be able to write to your XtraDB cluster.

---

<div class="post-metadata">

**Author:** ![katajistok](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@katajistok](https://forums.percona.com/u/katajistok)\
**Post date:** [March 8, 2022, 6:07am UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/4 "2022-03-08T06:07:40Z")

</div>

Hi,  
Could you advice how to get either super\_read\_only or read\_only to be enabled on XtraDB cluster?  
I have now on cr.yaml:

```auto
    configuration: |
      [mysqld]
      super_read_only = ON

```

But:

```auto
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl exec testreadonly-pxc-0 -c pxc -- mysql -uroot -proot_password -e'SHOW VARIABLES LIKE "read_only"';
mysql: [Warning] Using a password on the command line interface can be insecure.
Variable_name Value
read_only OFF
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl exec testreadonly-pxc-0 -c pxc -- mysql -uroot -proot_password -e'SHOW VARIABLES LIKE "super_read_only"';
mysql: [Warning] Using a password on the command line interface can be insecure.
Variable_name Value
super_read_only OFF

```

I also tried to enable “read\_only” from ConfigMap and from executing “SET GLOBAL read\_only = ON” on MySQL, but nothing have helped so far. For the record, this cluster does not have replication configured.

---

<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 8, 2022, 3:09pm UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/5 "2022-03-08T15:09:46Z")

</div>

Did you re-deploy the cr.yaml and restart the cluster (all pods)?

---

<div class="post-metadata">

**Author:** ![katajistok](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@katajistok](https://forums.percona.com/u/katajistok)\
**Post date:** [March 8, 2022, 5:42pm UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/6 "2022-03-08T17:42:17Z")

</div>

Yes. I tested all the things that came in to my mind. First I just edited cr.yaml and applied the changes, I think that Pod were restarted, but no effect. Then I tried to change ConfigMap - the same. And after this I removed cluster (kubectl delete -f cr.yaml) and re-created cluster (I didn’t touch on PVC’s).  
Only thing which helped (for a minute) was that I logged in to db node and executed that SET GLOBAL read\_only = ON. Then the setting was there for a minute or so.

---

<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 8, 2022, 5:57pm UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/7 "2022-03-08T17:57:17Z")

</div>

If the value was reset after you changed it, then there’s probably something our operator is doing which is not honoring the value in my.cnf. I’ll see if I can get an Operator dev to comment here.

---

<div class="post-metadata">

**Author:** ![katajistok](https://avatars.discourse-cdn.com/v4/letter/k/9f8e36/32.png) [@katajistok](https://forums.percona.com/u/katajistok)\
**Post date:** [March 9, 2022, 8:20am UTC](https://forums.percona.com/t/does-super-read-only-works-with-xtradb/14563/8 "2022-03-09T08:20:26Z")

</div>

Hi this is the cr.yaml which I’m now using: [cr - Pastebin.com](https://pastebin.com/wt2MvCfK).

Some commands:

```auto
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl get pods
NAME READY STATUS RESTARTS AGE
percona-xtradb-cluster-operator-566848cf48-nzxrp 1/1 Running 0 35h
testreadonly-haproxy-0 2/2 Running 0 95s
testreadonly-haproxy-1 2/2 Running 0 60s
testreadonly-haproxy-2 2/2 Running 0 40s
testreadonly-pxc-0 3/3 Running 0 95s
testreadonly-pxc-1 3/3 Running 0 65s
testreadonly-pxc-2 3/3 Running 0 35s
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl get pxc
NAME ENDPOINT STATUS PXC PROXYSQL HAPROXY AGE
testreadonly testreadonly-haproxy.dbaas-mysql-testreadonly ready 3 3 100s
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl exec testreadonly-pxc-0 -c pxc -- mysql -uroot -proot_password -e'SHOW VARIABLES LIKE "read_only"';
mysql: [Warning] Using a password on the command line interface can be insecure.
Variable_name Value
read_only OFF
[katajistok@dbaasjump002 mysql_production_configuration]$ kubectl exec testreadonly-pxc-0 -c pxc -- mysql -uroot -proot_password -e'SHOW VARIABLES LIKE "super_read_only"';
mysql: [Warning] Using a password on the command line interface can be insecure.
Variable_name Value
super_read_only OFF

```
