mars-project / mars-project/mars

[storage] Add batch.put API for storage

Open
#2,925 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

mod: service mod: storage
Dominant language
Python
Stars
2.7k
Forks
325
PR merge metrics
No merged PRs in 30d

Description

**Is your feature request related to a problem? Please describe.**
`Ray.put` with owner will issue an sync rpc to owner, when there are many obejcts to put, `Ray.put` will become the bottleneck for operand executing especially for shuffle mapper stage.
![image](https://user-images.githubusercontent.com/12445254/163764830-13a57312-f886-47ea-8f1d-60350c7d284b.png)

**Describe the solution you'd like**
A `batch.put` API will eliminate the issue.

With batch put:
![image](https://user-images.githubusercontent.com/12445254/163765154-63b853bd-d79d-4000-a7c4-b4da2cd09312.png)
without batch put
![image](https://user-images.githubusercontent.com/12445254/163765207-67d059b9-1f6e-4a1a-abd2-f61add9041f3.png)

The api can be added to `mars.storage.base.StorageBackend`:

```
@abstractmethod
async def batch_put(self, objects, importance: int = 0) -> List[ObjectInfo]:
return [self.put(obj, importance) for obj in objects]
```

If the storage client supports batch.put, it can override this method to get better performance.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading mars.storage.base.StorageBackend and its existing put implementations. Trace how storage clients handle multiple objects and identify which clients can support a batch.put operation. Done means the batch_put API is defined and supported clients can use it without the repeated synchronous owner RPC bottleneck.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
backend-api-design, distributed-systems
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.