Skip to content

PS-11204 [8.4] Granting SET_USER_ID breaks replication from 8.0 to 8.4#5991

Open
kamil-holubicki wants to merge 1 commit into
percona:8.4from
kamil-holubicki:PS-11204-8.4
Open

PS-11204 [8.4] Granting SET_USER_ID breaks replication from 8.0 to 8.4#5991
kamil-holubicki wants to merge 1 commit into
percona:8.4from
kamil-holubicki:PS-11204-8.4

Conversation

@kamil-holubicki
Copy link
Copy Markdown
Contributor

https://perconadev.atlassian.net/browse/PS-11204

Problem:
Newer replicas fail to apply replicated GRANT/REVOKE SET_USER_ID statements from older sources after SET_USER_ID was removed.

Cause:
Commit 3d0cfd5 ("WL#15875: Remove the deprecated SET_USER_ID privilege") removed SET_USER_ID from newer servers, but the replica SQL applier still replays the original query text from older sources and stops with ER_SYNTAX_ERROR when it encounters that legacy privilege.

Solution:
Add an opt-in compatibility rewrite in the replica applier that translates replicated SET_USER_ID to
SET_ANY_DEFINER,ALLOW_NONEXISTENT_DEFINER before parsing. Keep direct user-issued SQL unchanged, log when a rewrite happens, guard the feature with replica_translate_deprecated_priv, and cover it with an MTR test.

@kamil-holubicki
Copy link
Copy Markdown
Contributor Author

kamil-holubicki commented Jun 2, 2026

https://perconadev.atlassian.net/browse/PS-11204

Problem:
Newer replicas fail to apply replicated GRANT/REVOKE SET_USER_ID
statements from older sources after SET_USER_ID was removed.

Cause:
Commit 3d0cfd5 ("WL#15875: Remove the deprecated SET_USER_ID
privilege") removed SET_USER_ID from newer servers, but the replica SQL
applier still replays the original query text from older sources and
stops with ER_SYNTAX_ERROR when it encounters that legacy privilege.

Solution:
Add an opt-in compatibility rewrite in the replica applier that
translates replicated SET_USER_ID to
SET_ANY_DEFINER,ALLOW_NONEXISTENT_DEFINER before parsing. Keep direct
user-issued SQL unchanged, log when a rewrite happens, guard the feature
with replica_translate_deprecated_priv, and cover it with an MTR test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant