[MDEV-19074] Improved read_only mode for slaves with gtid_strict_mode enabled Created: 2019-03-28  Updated: 2020-08-25  Resolved: 2019-10-20

Status: Closed
Project: MariaDB Server
Component/s: Replication
Fix Version/s: 10.3.19, 10.4.9

Type: Task Priority: Major
Reporter: Valerii Kravchuk Assignee: Michael Widenius
Resolution: Fixed Votes: 0
Labels: None


 Description   

If read_only mode is set (as it's usual on slaves) users (even without SUPER privilege) are able to run ANALYZE TABLE and OPTIMIZE TABLE statements on the tables they have SELECT and INSERT privileges for. This is by current design and is clearly documented.

But running these commands on slave with binary logging enabled generates transactions for the binary logs. With gtid_strict_mode these transactions (with their increased seqno) then conflict with those coming from master, effectively breaking replication.

I'd like to request either some change in read_only implementation or maybe some safe_read_only_slave mode were these statements are NOT written to the binary log and do not generate new GTIDs when gtid_strict_mode is enabled, or their execution is prevented with error as follows:

1. If a user has SUPER privilege she should be allowed to execute all operations on slave.

2. If a user has all privileges on a specific database but not SUPER, she still should not be allowed to run OPTIMIZE, ANALYZE, DROP/CREATE TEMPORARY TABLE, FLUSH... etc, So for non-SUPER user it should not be allowed run any operations that are generating new GTIDs.

This is different from MySQL's super_read_only option.



 Comments   
Comment by Abdul Manaf [ 2019-03-29 ]

This will be really helpful to avoid slave breaks !

Comment by Abdul Manaf [ 2019-04-18 ]

Hi Team - is there any update on this feature

Comment by Michael Widenius [ 2019-10-20 ]

Temporary tables will not be logged in read-only mode. Temporary tables created while the server is
in read-only mode will not be logged even after the server has disabled the read-only mode.

Admin statements analyze, check and repair will also never be logged in read-only mode.

Generated at Thu Feb 08 08:48:52 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.