Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Honor select disposition in transactions #2322

Merged
merged 4 commits into from
Dec 21, 2023

Conversation

slorello89
Copy link
Collaborator

Fixes #2321

For transactions, if you remove SELECT from the command map, it will still try to send one if you issue an unknown/eval/evalsha command - this adds a bit of logic when enqueuing messages to interrogate the multiplexer to see if SELECT is in the command map.

@@ -117,20 +117,23 @@ private void QueueMessage(Message message)
{
(_pending ??= new List<QueuedMessage>()).Add(queued);

switch (message.Command)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we move the test inside the switch? I'd rather not execute the IsAvailable check etc unless we think there's a good need; other than that: makes sense

Copy link
Collaborator

@mgravell mgravell Dec 9, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not related to this change, but: unless I'm misreading the code, it looks like we'd issue this even on "cluster"; open question: should we also add a single-DB check? we usually know the DB count, either from server metadata (when available) or from the server type (note: DB count can be unknown)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good wrt to rearranging things.

WRT preventing an issue with cluster - what do you think of this new approach?

@NickCraver
Copy link
Collaborator

Dropping a reminder: Release notes please! Happy to add when ready at the end too, just making sure we remember :)

@slorello89
Copy link
Collaborator Author

Dropping a reminder: Release notes please! Happy to add when ready at the end too, just making sure we remember :)

sorry @NickCraver - added :)

@mgravell
Copy link
Collaborator

mgravell commented Dec 9, 2022

The more I look at this, the more I wonder whether this RedisTransaction code is actually needed, or the right place; the comparison is to here:

- IMO RediaTransaction might not need to do anything here, if we can refactor that linked code above a bit to handle sub-messages. I can look on Monday

@slorello89
Copy link
Collaborator Author

The more I look at this, the more I wonder whether this RedisTransaction code is actually needed, or the right place; the comparison is to here:

  • IMO RediaTransaction might not need to do anything here, if we can refactor that linked code above a bit to handle sub-messages. I can look on Monday

I see - it does seem a tad bit out of place. The code does intersect there to set the database to dirty I think - so it might just work if we ripped this bit out.

@mgravell mgravell merged commit e8b0006 into main Dec 21, 2023
@mgravell mgravell deleted the slorello89/honor-select-disposition-transactions branch December 21, 2023 15:04
NickCraver added a commit that referenced this pull request Jan 16, 2024
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.

SELECT command mapping not honored in transactions
3 participants