Skip to content

conditional shm get, eagain #2307

Open
Open
@bjne

Description

@bjne

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions