-
Notifications
You must be signed in to change notification settings - Fork 43
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
base: latest
Are you sure you want to change the base?
Conversation
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
870e4a7
to
c41464a
Compare
|
||
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>`. |
There was a problem hiding this comment.
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.
: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 |
There was a problem hiding this comment.
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.
:param string path: a path to put the value by | ||
:param string value: a value to put |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
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.
There was a problem hiding this 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!
This patchset focuses on updates in th
config
Lua module reference related toconfig.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 atime-to-live for the key in config.storage.
Closes https://github.com/tarantool/enterprise_doc/issues/281