nspcc-dev / nspcc-dev/neofs-node
Try to use metabase transaction context
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 38
- Forks
- 51
- Avg merge
- 1d 20h
- Merged PRs (30d)
- 38
Description
One of the problems with the metabase is excessive convertions of addresses/CID/OIDs to use as keys or bucket names.
The cost is non-negligible as can be seen from the benchmarks (will provide them shortly).
Describe the solution you'd like
Introduce tx-level cache containing the most frequently used values.
Converting some items to string can be done outside of the transaction, we also can reuse the same slice for creating bucket names.
type txContext struct {
tx *bbolt.Tx
addr string
cid string
oid string
bucketName []byte // preallocated bucket name
}
I have benched similar thing once, while trying it with pebble backend #619 , the result was positive. I think similar benefits are applicable to bolt.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the metabase implementation and its bbolt transaction paths, then review issue #619 for prior Pebble context. Define completion around measuring whether a transaction-level cache reduces conversions and reuses bucket-name storage, with benchmarks supplied for comparison.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- database, performance
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100