[IMPROVEMENT] Refactoring the task package used by instance manager proxy server
PhanLe1010 opened this issue Β· comments
Is your improvement request related to a feature? Please describe (π if you like this request)
In the current implementation, when longhorn-manager wants to do an engine/replica operation, the flow is:
- longhorn-manager send grpc call to instance-manager
- Then instance-manager does:
- Sometimes does additional handling logic like the task package in here https://github.com/longhorn/longhorn-instance-manager/blob/b88bfcfbeda854b0623cbc28df3468ea1fdcaadf/vendor/github.com/longhorn/longhorn-engine/pkg/sync/sync.go
- send gRPC calls to engine/replica
For example, this is the flow for replicaAdd operation (aka replica rebuilding or restore)
IMO, the additional handling logic like the task package above makes it more difficult to update and maintain. For example, this is one of the main challenges when trying to make the replica rebuilding operation async, ref #2765 (comment)
In a perfect world, I would prefer the IM proxy to only send/forward gRPC calls to engine/replica without adding any additional logic.
Describe the solution you'd like
Refactoring the task package used by instance manager proxy server to bring it outside of IM proxy