-
Notifications
You must be signed in to change notification settings - Fork 13
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(backend): replace maps with gokv.Store abstraction #671
base: main
Are you sure you want to change the base?
Conversation
Codecov Report
@@ Coverage Diff @@
## main #671 +/- ##
==========================================
- Coverage 76.53% 74.26% -2.28%
==========================================
Files 35 34 -1
Lines 3533 4010 +477
==========================================
+ Hits 2704 2978 +274
- Misses 752 921 +169
- Partials 77 111 +34
|
80f0683
to
7c305ee
Compare
d2ba72a
to
4ba64c7
Compare
Signed-off-by: Boris Glimcher <[email protected]>
Signed-off-by: Boris Glimcher <[email protected]>
Signed-off-by: Boris Glimcher <[email protected]>
Signed-off-by: Boris Glimcher <[email protected]>
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.
Looks good!
However, we need to try to implement keys collection and retrieval. Probably, by means of the idea we discussed last week. It will define if that storage library fits our needs
volume := new(pb.AioVolume) | ||
found, err := s.store.Get(in.AioVolume.Name, volume) | ||
if err != nil { | ||
return nil, err |
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.
I'd explicitly set gRPC error code as Internal
in all storage related operations by means of status.Errof(codes.Internal,...)
@@ -43,14 +44,21 @@ func (s *Server) CreateNvmeRemoteController(_ context.Context, in *pb.CreateNvme | |||
} | |||
in.NvmeRemoteController.Name = utils.ResourceIDToVolumeName(resourceID) | |||
// idempotent API when called with same key, should return same object | |||
volume, ok := s.Volumes.NvmeControllers[in.NvmeRemoteController.Name] | |||
if ok { | |||
volume := new(pb.NvmeRemoteController) |
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.
controller := ...
@@ -161,8 +183,12 @@ func (s *Server) UpdateNvmePath(_ context.Context, in *pb.UpdateNvmePathRequest) | |||
return nil, err | |||
} | |||
// fetch object from the database | |||
volume, ok := s.Volumes.NvmePaths[in.NvmePath.Name] | |||
if !ok { | |||
volume := new(pb.NvmePath) |
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.
nvmePath := ...
Signed-off-by: Boris Glimcher [email protected]