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

conditional shm get, eagain #2307

Open
bjne opened this issue Apr 26, 2024 · 3 comments
Open

conditional shm get, eagain #2307

bjne opened this issue Apr 26, 2024 · 3 comments

Comments

@bjne
Copy link

bjne commented Apr 26, 2024

Some time ago, an issue was raised: #1921, followed by a subsequent pull request: #1954.

The issue we aimed to address was selectively retrieving data from shared memory (shm) and deserializing it only if the version of the key in shm differed from what was stored in the least recently used (lru) cache or a local Lua variable. This feature could prove immensely useful for swiftly and accurately updating configuration changes while maintaining a cached copy in each worker for efficiency (which is validated upon request).

@agentzh, the original issue became somewhat complex due to the inclusion of both compare-or-get (cog) and compare-and-swap (cas) operations, as well as incorporating the original value into the get API. Could you or someone else reconsider this and possibly streamline it, for instance, into a function like get_conditional(key, flags?) returning value, flags, flags_match, where value and flags are returned only if flags_match is false?

@bjne
Copy link
Author

bjne commented Apr 30, 2024

@doujiang24 or @zhuizhuhaomeng, can any of you take another look?

@bjne
Copy link
Author

bjne commented Jun 6, 2024

ping @doujiang24 @zhuizhuhaomeng

@zhuizhuhaomeng
Copy link
Contributor

@bjne I will take a look at #1954 when I have time. Thanks for your remainder.

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

No branches or pull requests

2 participants