Skip to content

Add config.storage client and config.storage TTL option #5116

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: latest
Choose a base branch
from

Conversation

georgiy-belyanin
Copy link
Member

This patchset focuses on updates in th config Lua module reference related to
config.storage.

The first patch adds documentation for the config.storage_client module.
The module allows one to connect to a remote config.storage cluster and
use it as a key-value storage.

The examples on connecting to a config.storage instance via iproto has
been changed to an example on connecting to multiple config.storage
instances using the config.storage client and interacting with a
config.storage cluster.

Closes #4734

The second patch adds config.storage TTL option allowing one to specify a
time-to-live for the key in config.storage.

Closes https://github.com/tarantool/enterprise_doc/issues/281

@github-actions github-actions bot temporarily deployed to branch-config-storage-client May 15, 2025 16:31 Destroyed
This patch adds documentation for the `config.storage_client` module.
The module allows one to connect to a remote config.storage cluster and
use it as a key-value storage.

The examples on connecting to a config.storage instance via iproto has
been changed to an example on connecting to multiple config.storage
instances using the config.storage client and interacting with a
config.storage cluster.

Closes #4734
This patch adds a time-to-live (TTL) option to `config.storage` API
methods. This option allows one to put keys that will expire when the
passed time passes.

Closes tarantool/enterprise_doc#281

Put a value by the specified path.

:param string path: a path to put the value by
:param string value: a value to put
:param table opts: a table containing the following optional fields:

* ``ttl`` (since :doc:`3.2.0 </release/3.2.0>`, default: unset): time-to-live in seconds, if nil or not set the key won't expire, may issue an error if set on config.storage running old schema, see :ref:`config.storage.info <config_storage_api_reference_info>`.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AFAIR, we discussed a lot the following corner cases:

  • If a key exists and has no TTL, what put of this key with TTL do?
  • Vice versa: if the key exists and has TTL, what put of this key without TTL do?
  • Next, if a key has TTL that expires at time T and we attempt to put this key with a TTL that expires at time T1 < T, whether the expire occurs on T1 or T? How about T2 > T?

I would like if the API documentation would describe a behavior in these scenarios.

Comment on lines +644 to +652
:return: a table containing the following fields:

* ``data``: a table containing the information about the value:

* ``path``: a path
* ``mod_revision``: the last revision at which this value was modified
* ``value:``: a value

* ``revision``: a revision after performing the operation
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TBH, it is not very clear from this description, whether data contains the {path = <...>, mod_revision = <...>, value = <...>} mapping or an array of them. Since the call suport both point and prefix requests, I guess that it is either an array or a mapping of mappings. Anyway, I think that it would be nice to make it clear.

This is not really to this PR, because the description is the same as for the server API. Feel free to ignore.

Comment on lines +615 to +616
:param string path: a path to put the value by
:param string value: a value to put
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't know why, but it seems the rendering fails here:

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And in other places too.

Copy link
Member

@Totktonada Totktonada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants