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
Open
PS-11204 [8.4] Granting SET_USER_ID breaks replication from 8.0 to 8.4#5991kamil-holubicki wants to merge 1 commit into
kamil-holubicki wants to merge 1 commit into
Conversation
a8b0b98 to
e9c71eb
Compare
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.
e9c71eb to
5788912
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.