longhorn / longhorn

Cloud-Native distributed storage built on and for Kubernetes

Home Page:https://longhorn.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[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:

  1. longhorn-manager send grpc call to instance-manager
  2. Then instance-manager does:
    1. 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
    2. send gRPC calls to engine/replica

For example, this is the flow for replicaAdd operation (aka replica rebuilding or restore)
Screenshot from 2024-06-05 18-27-54

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

cc @shuo-wu @ejweber @c3y1huang @derekbit @innobead