Skip to content
Snippets Groups Projects
Commit 08070d45 authored by Vladimir Davydov's avatar Vladimir Davydov Committed by Vladimir Davydov
Browse files

read_view: add tuple_format to space_read_view

To support accessing tuple fields by name, we create a runtime tuple
format for each space read view, using the space field names to
initialize the field dictionary.

Note, we can't reuse the space tuple format as is, because it allocates
tuples from the engine arena, which is single-threaded, while a read
view may be used from any thread, not just tx. The runtime arena is
single-threaded as well, but we will make it per-thread in future.

Note, we can't even reuse tuple field dictionary - we create a new one
using the space definition instead - because the dictionary is in fact
mutable - it may be changed when the space definition is altered, see
tuple_dictionary_swap.

Good news is runtime tuple formats are reusable so if we create several
read views of the same space, they will all use the same tuple format.

Since this feature isn't required for snapshots/replication, we add
a read view option to enable it - read_view_opts::needs_field_names.

Needed for https://github.com/tarantool/tarantool-ee/issues/207

NO_DOC=internal
NO_TEST=ee
NO_CHANGELOG=internal
parent ab5010c6
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment