-
Notifications
You must be signed in to change notification settings - Fork 420
[Store] Check If Get Completed Within Lease #778
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
Merged
Merged
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
5be365b
Grant lease in GetReplicaListByRegex
ykwd 6ec4bf6
A temp version
ykwd 6685938
Simplify the logic
ykwd ba47e51
First version
ykwd 39a3ed0
Merge main
ykwd 2cd4e55
Eliminate unused var warning
ykwd c69ea33
refactor the code
ykwd 372cfbb
Format code
ykwd 3d1978b
Add unit test: temp version
ykwd 493c672
Format code. Add a unit test
ykwd 61967aa
Add unit tests
ykwd a70910d
Add unit tests
ykwd 9d532ae
Address comments
ykwd 6afcdf6
Address review
ykwd 6aa7da2
format code
ykwd e0387cf
Update docs
ykwd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,43 @@ | ||
| #pragma once | ||
|
|
||
| #include "types.h" | ||
| #include "replica.h" | ||
|
|
||
| namespace mooncake { | ||
|
|
||
| /** | ||
| * @brief Response structure for Ping operation | ||
| */ | ||
| struct PingResponse { | ||
| ViewVersionId view_version_id; | ||
| ClientStatus client_status; | ||
|
|
||
| PingResponse() = default; | ||
| PingResponse(ViewVersionId view_version, ClientStatus status) | ||
| : view_version_id(view_version), client_status(status) {} | ||
|
|
||
| friend std::ostream& operator<<(std::ostream& os, | ||
| const PingResponse& response) noexcept { | ||
| return os << "PingResponse: { view_version_id: " | ||
| << response.view_version_id | ||
| << ", client_status: " << response.client_status << " }"; | ||
| } | ||
| }; | ||
| YLT_REFL(PingResponse, view_version_id, client_status); | ||
|
|
||
| /** | ||
| * @brief Response structure for GetReplicaList operation | ||
| */ | ||
| struct GetReplicaListResponse { | ||
| std::vector<Replica::Descriptor> replicas; | ||
| uint64_t lease_ttl_ms; | ||
|
|
||
| GetReplicaListResponse() : lease_ttl_ms(0) {} | ||
| GetReplicaListResponse(std::vector<Replica::Descriptor>&& replicas_param, | ||
| uint64_t lease_ttl_ms_param) | ||
| : replicas(std::move(replicas_param)), | ||
| lease_ttl_ms(lease_ttl_ms_param) {} | ||
| }; | ||
| YLT_REFL(GetReplicaListResponse, replicas, lease_ttl_ms); | ||
|
|
||
| } // namespace mooncake |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a suggestion, maybe we could write "during lease, the object is read-only (or immutable)"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The immutability of an object once it is put is a fundamental property of the store, not limited to the lease period. Let me introduce this feature in another section.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated in another pr: 4cc34ba