tarantool / tarantool/tarantool

PRBuf doesn't allow to write msgpack directly

Open
#7,107 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

refactoring
Dominant language
Lua
Stars
3.7k
Forks
419
Avg merge
1d 23h
Merged PRs (30d)
88

Description

PRBuf (partition ring buffer) has now two stages API: prepare and commit; and you have to know exact size of record in prepare. That approach has a drawback when you need to build something complex, for example assemble msgpack stream from structured data. To build it we have either precalculate the size of result record (which is ugly) or build that stream in some other buffer and copy to PRBuf afterwards (which requires another buffer and additional copy).
It seems that we could create something like reserve-alloc API or add some streaming operations in PRBuf.

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 the PRBuf prepare and commit API, then trace how structured data is serialized into a msgpack stream. Compare a reserve-allocation approach with streaming operations, and define completion by allowing msgpack to be written directly without precalculating its size or using an extra buffer and copy.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
database
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.