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

feat(split): add partition_version #474

Merged
merged 4 commits into from
Feb 20, 2020
Merged

Conversation

hycdong
Copy link
Contributor

@hycdong hycdong commented Feb 12, 2020

What problem does this PR solve?

Add definition of partition_version, used for partition split to guarantee data consistency.

What is changed and how it works?

Check List

Tests

  • Unit test

Related changes

  • Need to cherry-pick to the release branch

@hycdong hycdong changed the title feat(split): add partition_version feat(split): add partition_version [WIP] Feb 13, 2020
@hycdong hycdong changed the title feat(split): add partition_version [WIP] feat(split): add partition_version Feb 20, 2020
@hycdong hycdong marked this pull request as ready for review February 20, 2020 02:50
@hycdong hycdong added the component/split partition split label Feb 20, 2020
@@ -340,6 +342,8 @@ class pegasus_server_impl : public ::dsn::apps::rrdb_service

pegasus_manual_compact_service _manual_compact_svc;

std::atomic<int32_t> _partition_version;
Copy link
Member

Choose a reason for hiding this comment

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

放到基类replication_app_base里面是不是更合理?毕竟pegasus_server_impl不应该知道partition这个概念

Copy link
Contributor Author

Choose a reason for hiding this comment

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

pegasus_server_impl也需要partition_version这个变量,split会让parent拥有child的数据,child也拥有parent的数据,在split完成之后这些无效数据应该要被删除,partition_version就被用于这个无效数据的清理,后续pr会交这部分的代码

Copy link
Member

Choose a reason for hiding this comment

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

现在还看不出来她的必要性,后面的pr我再看吧

@hycdong hycdong merged commit b7492ca into apache:master Feb 20, 2020
@neverchanje neverchanje mentioned this pull request Mar 31, 2020
neverchanje pushed a commit that referenced this pull request Mar 31, 2020
@hycdong hycdong deleted the partition_version branch June 3, 2020 07:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants