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

iproto: generate strings for vinyl constants

Currently, we fill vy_page_info_key_strs, vy_run_info_key_strs, and
vy_row_index_key_strs manually, which is inconvenient and error-prone.
Let's generate them automatically from enum member names, like we do
for IPROTO keys.

Note, we have to rename VY_RUN_INFO_BLOOM and VY_RUN_INFO_BLOOM_LEGACY
to VY_RUN_INFO_BLOOM_FILTER and VY_RUN_INFO_BLOOM_FILTER_LEGACY to
preserve the xlog reader output.

Still, the result isn't exactly the same:
 - An underscore is used instead of a space.
 - Strings are upper case now, not lower case, as they used to be.
 - VY_ROW_INDEX_DATA is now translated to "data", not "row index".

The key names are used for two purposes:
 - For reporting ER_INVALID_INDEX_FILE error in vy_run.c. The changes
   enumerated above don't really matter there.
 - In the xlog reader. We replace spaces with underscores anyway there
   and convert the names to the lower case so the only problem is that
   "row_index" is replaced with "data" in xlog reader output. This
   should be fine though because (a) from the context it's clear that
   the data belong to a row index section, (b) reading vinyl index files
   is only useful for debugging and introspection, and (c) the field is
   a part of vinyl internals and was never documented properly.

After this change we can remove the code replacing spaces with
underscores from the xlog reader because all IPROTO constant names
now use underscores.

Follow-up #8443
Follow-up commit b3fb883b ("iproto: export IPROTO constants to Lua
automatically")

NO_DOC=refactoring
NO_TEST=refactoring
NO_CHANGELOG=refactoring

(cherry picked from commit 96599a5b)
parent 438ad9b5
No related branches found
No related tags found
Loading
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