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

fix index data loss when insert data during rebuilding index #408

Merged
merged 2 commits into from
Mar 26, 2021

Conversation

panda-sheep
Copy link
Contributor

As title.

The steps are as follows:

  1. 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.

  2. Because AddVerticesProcessor::doProcessWithIndex writes vector data into the operation table asynchronously. Release env_->onFlyingRequest in IndexCountWrapper wrapper before writing.

  3. In RebuildIndexTask::buildIndexOnOperations, if it is judged that env_->onFlyingRequest is 0, it is assumed that the operation table data has been processed, and the rebuild part is completed.

  4. 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.

@panda-sheep panda-sheep added the ready-for-testing PR: ready for the CI test label Mar 24, 2021
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.

Good job.

@panda-sheep 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 panda-sheep force-pushed the fix_index_data_loss branch from 4b67b63 to 1ac6c6e Compare March 25, 2021 10:06
@panda-sheep panda-sheep force-pushed the fix_index_data_loss branch from 1ac6c6e to e324c82 Compare March 25, 2021 15:03
Copy link
Contributor

@bright-starry-sky bright-starry-sky left a comment

Choose a reason for hiding this comment

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

Well done.

@CLAassistant
Copy link

CLAassistant commented Mar 26, 2021

CLA assistant check
All committers have signed the CLA.

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 now, well done

@critical27 critical27 merged commit 4ba3f19 into vesoft-inc:master Mar 26, 2021
@panda-sheep panda-sheep deleted the fix_index_data_loss branch March 26, 2021 02:05
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.
Labels
ready-for-testing PR: ready for the CI test
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants