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(core): support load vertex/edge snapshot #269

Merged
merged 6 commits into from
Oct 22, 2023

Conversation

Radeity
Copy link
Member

@Radeity Radeity commented Sep 24, 2023

Purpose of the PR

Main Changes

  • Use MinIO to store snapshot files, and add MinIO configuration to build the MinIO client.
  • Add SnapshotManager to handle snapshot load and write.

Verifying these changes

  • Trivial rework / code cleanup without any test coverage. (No Need)

  • Already covered by existing tests, such as (please modify tests here).

  • Need tests and can be verified as follows.

  • For my LOCAL test, I deploy MinIO in standalone mode first. Then I test all possible scenarios when using this feature. And here's my testing results:

    当前无快照可读  

    read snapshot write snapshot 期望状态 check
    true false FAIL
    false true 不读快照,成功写快照
    true true FAIL
    false false 普通的一次执行(default)

    当前有快照可读

    read snapshot write snapshot 期望状态 check
    true false 成功读快照,不写新快照
    false true 不读快照,更新快照
    true true 成功读快照,不写新快照
    false false 普通的一次执行(default)

In later PR, I will support to deploy MinIO as internal storage. Then, I will add UT to replace manual test results.

Later PR (Task)

  • Use helm to deploy MinIO together with Operator, and then user can use snapshot feature out-of-the-box.
  • Add UT after MinIO is available in test environment (after the first task).
  • Add doc.
  • Add license.

Does this PR potentially affect the following parts?

  • Nope
  • Dependencies (add/update license info)
  • Modify configurations
  • The public API
  • Other affects (typed here)

Documentation Status

  • Doc - TODO
  • Doc - Done
  • Doc - No Need

Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

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

nice enhancement

@imbajin imbajin requested review from coderzc and simon824 September 25, 2023 01:28
@Radeity
Copy link
Member Author

Radeity commented Sep 25, 2023

Hi @javeme , thanks for your comments, I will pay more attention at next time to write beautiful codes : )

public static final ConfigOption<String> SNAPSHOT_VIEW_KEY =
new ConfigOption<>(
"snapshot.view_key",
"View key of target snapshot",
Copy link
Contributor

Choose a reason for hiding this comment

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

what does the view key mean? do we have a concept that is easier to understand?

Copy link
Member Author

@Radeity Radeity Oct 2, 2023

Choose a reason for hiding this comment

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

Maybe we can use SNAPSHOT_NAME instead, just a user-defined unique identifier of the snapshot.

Copy link
Member Author

Choose a reason for hiding this comment

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

Hi @javeme , I wanna make sure is there any other confusion about it before make changes.

Copy link
Contributor

Choose a reason for hiding this comment

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

get it. SNAPSHOT_NAME seems easy to understand

javeme
javeme previously approved these changes Oct 12, 2023
Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

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

LGTM

@codecov
Copy link

codecov bot commented Oct 13, 2023

Codecov Report

Merging #269 (f3a2e5b) into master (15fc9bb) will decrease coverage by 0.66%.
Report is 1 commits behind head on master.
The diff coverage is 32.94%.

@@             Coverage Diff              @@
##             master     #269      +/-   ##
============================================
- Coverage     85.81%   85.15%   -0.66%     
- Complexity     3233     3248      +15     
============================================
  Files           344      345       +1     
  Lines         12115    12283     +168     
  Branches       1092     1101       +9     
============================================
+ Hits          10396    10460      +64     
- Misses         1195     1297     +102     
- Partials        524      526       +2     
Files Coverage Δ
...ugegraph/computer/core/config/ComputerOptions.java 98.94% <100.00%> (+0.05%) ⬆️
...aph/computer/core/receiver/MessageRecvManager.java 85.22% <100.00%> (+0.34%) ⬆️
...h/computer/core/receiver/MessageRecvPartition.java 97.59% <100.00%> (+0.02%) ⬆️
.../computer/core/receiver/MessageRecvPartitions.java 97.72% <100.00%> (+0.10%) ⬆️
...receiver/message/ComputeMessageRecvPartitions.java 100.00% <100.00%> (ø)
.../hugegraph/computer/core/worker/WorkerService.java 90.58% <100.00%> (+0.11%) ⬆️
.../core/receiver/edge/EdgeMessageRecvPartitions.java 66.66% <50.00%> (-33.34%) ⬇️
...e/receiver/vertex/VertexMessageRecvPartitions.java 66.66% <50.00%> (-33.34%) ⬇️
...egraph/computer/core/input/WorkerInputManager.java 90.56% <70.00%> (-5.18%) ⬇️
...computer/core/network/buffer/FileRegionBuffer.java 35.71% <0.00%> (-3.76%) ⬇️
... and 1 more

... and 7 files with indirect coverage changes

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@javeme javeme left a comment

Choose a reason for hiding this comment

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

LGTM

@Radeity Radeity changed the title feat: support load vertex/edge snapshot feat(core): support load vertex/edge snapshot Oct 18, 2023
for (int partitionId = 0; partitionId < this.partitionCount; partitionId++) {
if (this.partitioner.workerId(partitionId) == id) {
// TODO: Do not need to send control message to all workers
this.sendManager.startSend(MessageType.VERTEX);
Copy link
Member

Choose a reason for hiding this comment

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

Why we need to send control message?

Copy link
Member Author

Choose a reason for hiding this comment

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

We skip loadGraph() step when using snapshot, if we don't send control message, next steps will not go on.

@coderzc coderzc merged commit 2e45cd2 into apache:master Oct 22, 2023
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[Feature] Support load vertex/edge snapshot
3 participants