Skip to content
This repository has been archived by the owner on Dec 1, 2022. It is now read-only.

restore update atomic operation #428

Merged

Conversation

panda-sheep
Copy link
Contributor

@panda-sheep panda-sheep commented Apr 9, 2021

update is read-modify-write, which is an atomic operation.
pr #355 change update operation into a non-atomic operation.
The result of the current update is unstable.

According to the logic before this modification, the following case:

create tag course(credits int);
insert vertex course(credits) VALUES "200":(1);

Then the two clients are executed separately

UPSERT VERTEX "200" SET course.credits = 2 WHEN $^.course.credits == 1 YIELD $^.course.credits;
UPSERT VERTEX "200" SET course.credits = 3 WHEN $^.course.credits == 1 YIELD $^.course.credits;

The second update statement may be executed successfully or failed.

The expectations are:
The execution of the second update statement failed.

Copy link
Contributor

@critical27 critical27 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@liuyu85cn liuyu85cn left a comment

Choose a reason for hiding this comment

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

LGTM

@critical27 critical27 merged commit 253338d into vesoft-inc:master Apr 12, 2021
@panda-sheep panda-sheep deleted the fix_update_atomic_operation branch April 12, 2021 04:48
jude-zhu pushed a commit to jude-zhu/nebula-storage that referenced this pull request Apr 12, 2021
jude-zhu added a commit to jude-zhu/nebula-storage that referenced this pull request Apr 12, 2021
bright-starry-sky pushed a commit that referenced this pull request Apr 12, 2021
* check type of index (#426)

* check type of index

* delete get

(cherry picked from commit ba7af28)

* Specify nebula common branch when checkout (#422)

Co-authored-by: dutor <[email protected]>
Co-authored-by: CBS <[email protected]>
(cherry picked from commit af0bcc4)

* fix update atomic operation (#428)

(cherry picked from commit 253338d)

* #428

* remove extra space

Co-authored-by: jimingquan <[email protected]>
Co-authored-by: Yee <[email protected]>
Co-authored-by: panda-sheep <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants