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

[Raft] Add a direct delete request #6384

Merged
merged 2 commits into from
Apr 16, 2024
Merged

[Raft] Add a direct delete request #6384

merged 2 commits into from
Apr 16, 2024

Conversation

luluz66
Copy link
Contributor

@luluz66 luluz66 commented Apr 16, 2024

Related issues: N/A
DirectDelete is used to delete keys in meta range. The current Delete method
only allows us to delete file records. We need this methods to maintain
transaction records.

@@ -803,6 +803,15 @@ func (sm *Replica) directWrite(wb pebble.Batch, req *rfpb.DirectWriteRequest) (*
return &rfpb.DirectWriteResponse{}, err
}

func (sm *Replica) directDelete(wb pebble.Batch, req *rfpb.DirectDeleteRequest) (*rfpb.DirectDeleteResponse, error) {
if !isLocalKey(req.GetKey()) {
return nil, status.InvalidArgumentErrorf("cannot direct delete non-local key")
Copy link
Member

Choose a reason for hiding this comment

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

nit: "cannot direct delete non-local key; use Delete instead"

@luluz66 luluz66 merged commit 7b48fcb into master Apr 16, 2024
17 of 18 checks passed
@luluz66 luluz66 deleted the direct-delete branch April 16, 2024 19:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants