v6d-io / v6d

vineyard (v6d): an in-memory immutable data manager. (Project under CNCF, TAG-Storage)
https://v6d.io
Apache License 2.0
829 stars 122 forks source link

Put object to the vineyardd with the least memory usage while the connected one is out of memory #1807

Closed dashanji closed 6 months ago

dashanji commented 7 months ago

Describe your problem

When the connected vineyardd is out of memory, the client can't put anything in the vineyardd. However, in the k8s cluster, the memory of vineyardd cluster(e,g, 3 replicas) will not be maximally used.

To avoid this, we can improve the current put function:

  1. When the NotEnoughMemoryException occurs, we can find all vineyardd info via client.meta, then create multiple clients to connect all vineyardd servers. (for each vineyardd, connect via ipc firstly)
  2. Find the vineyardd with the least memory usage and put the object in it.