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

CreateBackup: backup IncrementalId as well #526

Merged
merged 3 commits into from
Jul 16, 2021

Conversation

linkensphere201
Copy link
Contributor

As titled, backup the missed IncrementalID for meta service.

panda-sheep
panda-sheep previously approved these changes Jul 14, 2021
critical27
critical27 previously approved these changes Jul 14, 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.

LGTM, good job

@@ -155,7 +155,7 @@ ErrorOr<nebula::cpp2::ErrorCode, std::vector<HostAddr>> BaseProcessor<RESP>::all
template<typename RESP>
ErrorOr<nebula::cpp2::ErrorCode, int32_t> BaseProcessor<RESP>::autoIncrementId() {
folly::SharedMutex::WriteHolder holder(LockUtils::idLock());
static const std::string kIdKey = "__id__";
static const std::string kIdKey = MetaServiceUtils::idKey();
Copy link
Contributor

Choose a reason for hiding this comment

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

What if that static map is not initialized at this time ? I mean I've heard that C++ not guarantee the sequence of two static.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

great catch. it looks like a problem. removed static here. I think the RVO would take place.

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.

5 participants