[feature] add GTID_NON_DETERMINISM flag to reject non-deterministic c… - #439
Merged
qiongtubao merged 3 commits intoAug 13, 2026
Merged
Conversation
qiongtubao
force-pushed
the
feature/gtid_rewrite_commands_8x
branch
from
August 9, 2026 18:56
03f4ea1 to
5527f37
Compare
added 3 commits
August 13, 2026 16:23
…ommands in GTID Add CMD_GTID_NON_DETERMINISM (1ULL<<30) flag to mark commands whose results are non-deterministic and thus unsafe inside GTID transactions: - Blocking operations (BLPOP, BRPOP, BLMOVE, BLMPOP, BZMPOP, BZPOPMAX, BZPOPMIN, BRPOPLPUSH) - Random/time-based commands (SPOP, SRANDMEMBER, RANDOMKEY — via rewrite-command flag handling) - Expiry with time generation (EXPIRE, EXPIREAT, PEXPIRE, SETEX, PSETEX, SETEX, GETEX, GETSET, SETRANGE, APPEND, INCRBYFLOAT) - Hash field operations (HINCRBY, HINCRBYFLOAT, HEXPIRE, HPEXPIRE, HGETDEL, HGETEX, HSETEX) Flag parsing and reply support: - src/server.c: "rewrite_command" in addReplyFlagsForCommand - src/module.c: "rewrite-command" in commandFlagsFromString Users sending these commands directly in GTID context are rejected, while MASTER replication (CLIENT_MASTER) bypasses the check, ensuring correct propagation. deps/xredis-gtid updated to 2cbc573 (reject rewrite commands inside GTID and add tests).
qiongtubao
force-pushed
the
feature/gtid_rewrite_commands_8x
branch
from
August 13, 2026 08:35
5527f37 to
f274abe
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.
…ommands in GTID
Add CMD_GTID_NON_DETERMINISM (1ULL<<30) flag to mark commands whose results are non-deterministic and thus unsafe inside GTID transactions:
Flag parsing and reply support:
Users sending these commands directly in GTID context are rejected, while MASTER replication (CLIENT_MASTER) bypasses the check, ensuring correct propagation.
deps/xredis-gtid updated to 2cbc573 (reject rewrite commands inside GTID and add tests).