Skip to content

Make optimistic version locking optional #856

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

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sgtsquiggs
Copy link

@sgtsquiggs sgtsquiggs commented Jun 11, 2025

This PR will make the reids:",ver" tag optional. This PR will resolve #854.

Usecase:

You are using rueidis/om to keep a cache up-to-date, reading directly off a kafka queue. You do not want to deal with versioning your data in redis. You are always upserting.

TODO:

  • Update README and documentation

Comment on lines +74 to +75
s.ver = &field{reflect.TypeOf(int64(0)), "", -1, false, true, false}
s.verless = true
Copy link
Collaborator

Choose a reason for hiding this comment

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

I wonder if it is possible to just keep s.ver == nil?

Copy link
Author

Choose a reason for hiding this comment

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

Definitely can do that, just would result in more LOC changed.

Copy link
Collaborator

Choose a reason for hiding this comment

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

@sgtsquiggs, maybe we should keep the current approach. Is this PR ready for merge?

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.

Let us disable optimistic locking in github.com/redis/rueidis/om
2 participants