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

fix(json): JSON.MSET may update on the old json value #2579

Merged

Conversation

poipoiPIO
Copy link
Contributor

Possible fix for #2552, suggested by @VIVALXH

Summary:

This PR extends the JSON.MSet method by temporarily storing modified JSON objects in memory to prevent multiple data rewrites performed on a single key and only then writing the resulting key objects to the batch.

src/types/redis_json.cc Outdated Show resolved Hide resolved
Copy link
Member

@git-hulk git-hulk left a comment

Choose a reason for hiding this comment

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

@poipoiPIO Thanks for your contribution. This PR looks good to me except for adding some comments to explain the reason.

src/types/redis_json.cc Show resolved Hide resolved
src/types/redis_json.cc Show resolved Hide resolved
Co-authored-by: hulk <hulk.website@gmail.com>
Co-authored-by: Twice <twice@apache.org>
@git-hulk git-hulk changed the title fix: JSON.MSET multi-command query applied to one key writes only the last modification fix(json): JSON.MSET may update on the old json value Oct 5, 2024
git-hulk
git-hulk previously approved these changes Oct 5, 2024
@git-hulk git-hulk requested a review from PragmaTwice October 5, 2024 10:16
PragmaTwice
PragmaTwice previously approved these changes Oct 5, 2024
src/types/redis_json.cc Outdated Show resolved Hide resolved
Co-authored-by: Twice <twice@apache.org>
@poipoiPIO poipoiPIO dismissed stale reviews from PragmaTwice and git-hulk via 00bec20 October 5, 2024 10:53
Copy link

sonarqubecloud bot commented Oct 5, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint

@PragmaTwice PragmaTwice merged commit 0d5f851 into apache:unstable Oct 5, 2024
31 of 32 checks passed
@poipoiPIO
Copy link
Contributor Author

Thank y'all for the review!

git-hulk added a commit that referenced this pull request Oct 18, 2024
…ctly (#2579)

Co-authored-by: hulk <hulk.website@gmail.com>
Co-authored-by: Twice <twice@apache.org>
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.

3 participants