This repository has been archived by the owner on Dec 1, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 50
fix index data loss when insert data during rebuilding index #408
Merged
critical27
merged 2 commits into
vesoft-inc:master
from
panda-sheep:fix_index_data_loss
Mar 26, 2021
Merged
fix index data loss when insert data during rebuilding index #408
critical27
merged 2 commits into
vesoft-inc:master
from
panda-sheep:fix_index_data_loss
Mar 26, 2021
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
panda-sheep
requested review from
bright-starry-sky,
critical27,
liuyu85cn and
darionyaphet
and removed request for
bright-starry-sky
March 24, 2021 09:54
critical27
reviewed
Mar 24, 2021
critical27
reviewed
Mar 24, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good job.
panda-sheep
changed the title
fix index data loss when insert data during rebuilding index,
fix index data loss when insert data during rebuilding index
Mar 24, 2021
panda-sheep
force-pushed
the
fix_index_data_loss
branch
from
March 25, 2021 10:06
4b67b63
to
1ac6c6e
Compare
panda-sheep
force-pushed
the
fix_index_data_loss
branch
from
March 25, 2021 15:03
1ac6c6e
to
e324c82
Compare
bright-starry-sky
approved these changes
Mar 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well done.
critical27
approved these changes
Mar 26, 2021
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM now, well done
jude-zhu
pushed a commit
that referenced
this pull request
Apr 1, 2021
* fix index data loss when insert data during rebuilding index, * address critical27's comment (cherry picked from commit 4ba3f19)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As title.
The steps are as follows:
If the index status of the specified space specified part is the building state at this time
In
AddVerticesProcessor::doProcessWithIndex
, the old index data to be deleted and the new index data added are organized into a vector, ready to be added to the operation table.Because
AddVerticesProcessor::doProcessWithIndex
writes vector data into the operation table asynchronously. Releaseenv_->onFlyingRequest
inIndexCountWrapper wrapper
before writing.In
RebuildIndexTask::buildIndexOnOperations
, if it is judged thatenv_->onFlyingRequest
is 0, it is assumed that the operation table data has been processed, and the rebuild part is completed.At this time, step 2 writes the data into the operation table. At this time, the data written into the part in the operation table will always be invalid, because the data will never be processed.
So this part of the index data is lost.
Thanks chaos for discovering this problem.