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

add db-upgrade V3 #3417

Merged
merged 16 commits into from
Dec 28, 2021
Merged

add db-upgrade V3 #3417

merged 16 commits into from
Dec 28, 2021

Conversation

cangfengzhs
Copy link
Contributor

@cangfengzhs cangfengzhs commented Dec 6, 2021

What type of PR is this?

  • bug
  • feature
  • enhancement

What does this PR do?

Which issue(s)/PR(s) this PR relates to?

Special notes for your reviewer, ex. impact of this fix, etc:

Additional context:

Checklist:

  • Documentation affected (Please add the label if documentation needs to be modified.)
  • Incompatible (If it is incompatible, please describe it and add corresponding label.)
  • Need to cherry-pick (If need to cherry-pick to some branches, please label the destination version(s).)
  • Performance impacted: Consumes more CPU/Memory

Release notes:

Please confirm whether to reflect in release notes and how to describe:

                                                            `

@cangfengzhs cangfengzhs added the ready-for-testing PR: ready for the CI test label Dec 15, 2021
@cangfengzhs cangfengzhs marked this pull request as ready for review December 15, 2021 08:57
@codecov-commenter
Copy link

codecov-commenter commented Dec 20, 2021

Codecov Report

Merging #3417 (6399d5a) into master (99f1f7a) will increase coverage by 0.02%.
The diff coverage is 95.06%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #3417      +/-   ##
==========================================
+ Coverage   85.19%   85.22%   +0.02%     
==========================================
  Files        1304     1307       +3     
  Lines      121308   122545    +1237     
==========================================
+ Hits       103352   104433    +1081     
- Misses      17956    18112     +156     
Impacted Files Coverage Δ
src/clients/storage/StorageClient.h 100.00% <ø> (ø)
src/clients/storage/StorageClientBase-inl.h 74.61% <ø> (+1.93%) ⬆️
src/graph/validator/MutateValidator.h 100.00% <ø> (ø)
src/storage/mutate/AddEdgesProcessor.h 100.00% <ø> (ø)
src/storage/mutate/AddVerticesProcessor.h 100.00% <ø> (ø)
src/clients/meta/MetaClient.cpp 74.97% <50.00%> (+0.43%) ⬆️
src/storage/mutate/AddEdgesProcessor.cpp 59.86% <78.57%> (+3.20%) ⬆️
src/clients/storage/StorageClient.cpp 78.68% <100.00%> (+0.24%) ⬆️
src/graph/executor/mutate/InsertExecutor.cpp 100.00% <100.00%> (ø)
src/graph/planner/plan/Mutate.h 100.00% <100.00%> (ø)
... and 105 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update e6ddeb2...6399d5a. Read the comment docs.

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.

Generally LGTM, write a storage version mark to each rocksdb.
We will check meta's version when we call waitForMetadReady, after meta is upgraded to V3, you could check it later, the PR is coming.
BTW, better rename upgrade_version.

key.resize(key.size() - sizeof(TagID));
return key;
}
std::string NebulaKeyUtilsV3::dataVersionKey() { return "\xFF\xFF\xFF\xFF"; }
Copy link
Contributor

Choose a reason for hiding this comment

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

You could move it to NebulaKeyUtils

critical27
critical27 previously approved these changes Dec 23, 2021
"",
"When the value is 1:2, upgrade the data from 1.x to 2.0 GA. "
"When the value is 2RC:2, upgrade the data from 2.0 RC to 2.0 GA."
"When the value is 2:3, upgrade the data from ");
Copy link
Contributor

Choose a reason for hiding this comment

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

from what?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

My mistake

wenhaocs
wenhaocs previously approved these changes Dec 23, 2021
}
auto code = readEngine_->ingest(ingest_sst_file_, true);
if (code != ::nebula::cpp2::ErrorCode::SUCCEEDED) {
LOG(FATAL) << "Faild upgrade 2:3 when ingest sst file:" << static_cast<int>(code);
Copy link
Contributor

Choose a reason for hiding this comment

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

LOG(FATAL) will cause crash ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, and if ingest failed, upgrader can do nothing except crash.

darionyaphet
darionyaphet previously approved these changes Dec 23, 2021
@@ -83,7 +86,7 @@ Status UpgraderSpace::initSpace(const std::string& sId) {

// Use readonly rocksdb
readEngine_.reset(new nebula::kvstore::RocksEngine(
spaceId_, spaceVidLen_, srcPath_, "", nullptr, nullptr, true));
spaceId_, spaceVidLen_, srcPath_, "", nullptr, nullptr, false));
Copy link
Contributor

Choose a reason for hiding this comment

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

why change?

Copy link
Contributor

Choose a reason for hiding this comment

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

This rocksdb is originally a read-only

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because upgrade to 3.0 just need append new data by ingest sst file and write a dataVersionKey to identity the data encode version. So there is no need to write a new rocksdb, just upgrade in place

Copy link
Contributor

Choose a reason for hiding this comment

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

ok

Copy link
Contributor

Choose a reason for hiding this comment

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

Confused about readEngine_.reset a writeable one

Copy link
Contributor Author

Choose a reason for hiding this comment

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

read means source and write means destnation

wenhaocs
wenhaocs previously approved these changes Dec 23, 2021
@yixinglu yixinglu removed the LGTM2 label Dec 25, 2021
@critical27 critical27 merged commit a89e5b3 into vesoft-inc:master Dec 28, 2021
@Sophie-Xie Sophie-Xie added the doc affected PR: improvements or additions to documentation label Jan 4, 2022
@foesa-yang foesa-yang added this to To do in Nebula Docs Jan 17, 2022
@randomJoe211 randomJoe211 moved this from To do to Done in Nebula Docs Feb 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
doc affected PR: improvements or additions to documentation ready for review ready-for-testing PR: ready for the CI test
Projects
Development

Successfully merging this pull request may close these issues.

None yet

9 participants