-
Notifications
You must be signed in to change notification settings - Fork 43
Add tt cat, play, rocks #3065
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
Merged
Merged
Add tt cat, play, rocks #3065
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
c2708db
Add tt cat, play, rocks
p7nov 6882287
Add details on tt play
p7nov 39f682e
Add tt rocks flags and commands
p7nov 7d562a4
Add tt rocks details
p7nov 10cca63
Fix
p7nov 909e0b9
Review fixes
p7nov e19c022
Proofread
patiencedaur File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
Printing the contents of .snap and .xlog files | ||
============================================== | ||
|
||
.. code-block:: bash | ||
|
||
tt cat FILE .. [flags] | ||
|
||
``tt cat`` prints the contents of :ref:`snapshot <internals-snapshot>` (``.snap``) and | ||
:ref:`WAL <internals-wal>` (``.xlog``) files to stdout. A single call of ``tt cat`` can | ||
print the contents of multiple files. | ||
|
||
|
||
Flags | ||
----- | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 20 80 | ||
:header-rows: 0 | ||
|
||
* - ``--format`` | ||
- Output format: ``yaml`` (default), ``json``, or ``lua`` | ||
* - ``--from`` | ||
- Show operations starting from the given LSN | ||
* - ``--to`` | ||
- Show operations up to the given LSN. Default: 18446744073709551615 | ||
* - ``--replica`` | ||
- Filter the output by replica ID. Can be passed more than once | ||
* - ``--space`` | ||
- Filter the output by space ID. Can be passed more than once | ||
* - ``--show-system`` | ||
- Show the contents of system spaces | ||
|
||
Details | ||
------- | ||
|
||
When calling ``tt cat`` with filters by LSN (``--from`` and ``--to`` flags) and | ||
replica ID (``--replica``), remember that LSNs differ across replicas. | ||
Thus, if you pass more than one replica ID via ``--from`` or ``--to``, | ||
the result may not reflect the actual sequence of operations. | ||
|
||
Examples | ||
-------- | ||
|
||
* Output contents of ``00000000000000000000.xlog`` WAL file in the YAML format: | ||
|
||
.. code-block:: bash | ||
|
||
tt cat 00000000000000000000.xlog | ||
|
||
* Output operations on spaces with ``space_id`` 512 and 513 from the | ||
``00000000000000000012.snap`` snapshot file in the JSON format: | ||
|
||
.. code-block:: bash | ||
|
||
tt cat 00000000000000000012.snap --space 512 --space 513 --format json | ||
|
||
* Output operations on all spaces, including system spaces, | ||
from the ``00000000000000000000.xlog`` WAL file: | ||
|
||
.. code-block:: bash | ||
|
||
tt cat 00000000000000000000.xlog --show-system | ||
|
||
* Output operations with LSNs between 100 and 500 on replica 1 | ||
from the ``00000000000000000000.xlog`` WAL file: | ||
|
||
.. code-block:: bash | ||
|
||
tt cat 00000000000000000000.xlog --from 100 --to 500 --replica 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,77 @@ | ||
Playing the contents of .snap and .xlog files to a Tarantool instance | ||
===================================================================== | ||
|
||
.. code-block:: bash | ||
|
||
tt play URI FILE .. [flags] | ||
|
||
``tt play`` plays the contents of :ref:`snapshot <internals-snapshot>` (``.snap``) and | ||
:ref:`WAL <internals-wal>` (``.xlog``) files to another Tarantool instance. | ||
A single call of ``tt play`` can play multiple files. | ||
|
||
Flags | ||
----- | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 20 80 | ||
:header-rows: 0 | ||
|
||
* - ``--from`` | ||
- Play operations starting from the given LSN | ||
* - ``--to`` | ||
- Play operations up to the given LSN. Default: 18446744073709551615 | ||
* - ``--replica`` | ||
p7nov marked this conversation as resolved.
Show resolved
Hide resolved
|
||
- Filter the operations by replica id. Can be passed more than once | ||
* - ``--space`` | ||
- Filter the operations by space id. Can be passed more than once | ||
* - ``--show-system`` | ||
- Play the operations on system spaces | ||
|
||
Details | ||
------- | ||
|
||
``tt play`` plays operations from ``.xlog`` and ``.snap`` files to the destination | ||
instance one by one. All data changes happen the same way as if they were performed | ||
on this instance. This means that: | ||
|
||
* All affected spaces must exist on the destination instance. They must have the same structure | ||
and ``space_id`` as on the instance that created the snapshot or WAL file. | ||
|
||
To play a snapshot or a WAL to a clean instance, include the operations on system spaces | ||
by adding the ``--show-system`` flag. With this flag, ``tt`` plays the operations that | ||
create and configure user-defined spaces. | ||
|
||
* The operations' LSNs will change unless you play all operations that took place since the instance startup. | ||
|
||
* Replica IDs will change in accordance with the destination instance configuration. | ||
|
||
|
||
When calling ``tt play`` with filters by LSN (``--from`` and ``--to`` flags) and | ||
replica ID (``--replica``), remember that LSNs differ across replicas. | ||
Thus, if you pass more than one replica ID via ``--from`` or ``--to``, | ||
the result may not reflect the actual sequence of operations. | ||
|
||
Examples | ||
-------- | ||
|
||
* Play the contents of ``00000000000000000000.xlog`` to the instance on | ||
``192.168.10.10:3301``: | ||
|
||
.. code-block:: bash | ||
|
||
tt play 192.168.10.10:3301 00000000000000000000.xlog | ||
|
||
* Play operations on spaces with ``space_id`` 512 and 513 from the | ||
``00000000000000000012.snap`` snapshot file: | ||
|
||
.. code-block:: bash | ||
|
||
tt play 192.168.10.10:3301 00000000000000000012.snap --space 512 --space 513 | ||
|
||
* Play the contents of ``00000000000000000000.xlog`` including operations on system spaces: | ||
|
||
.. code-block:: bash | ||
|
||
tt play 192.168.10.10:3301 00000000000000000000.xlog --show-system |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,145 @@ | ||
Using the LuaRocks package manager | ||
================================== | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks [FLAG ...] [VAR=VALUE] COMMAND [ARGUMENT] | ||
|
||
``tt rocks`` provides means to manage Lua modules (rocks) via the | ||
`LuaRocks <https://luarocks.org/>`_ package manager. `tt` uses its own | ||
LuaRocks installation connected to the `Tarantool rocks repository <https://www.tarantool.io/en/download/rocks>`_. | ||
|
||
Below are lists of supported LuaRocks flags and commands. For detailed information on | ||
their usage, refer to `LuaRocks documentation <https://github.com/luarocks/luarocks/wiki/Documentation>`_. | ||
|
||
Flags | ||
----- | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 30 70 | ||
:header-rows: 0 | ||
|
||
* - ``--dev`` | ||
- Enable the sub-repositories in rocks servers | ||
for rockspecs of in-development versions | ||
* - ``--server=<server>`` | ||
- Fetch rocks/rockspecs from this server | ||
(takes priority over config file) | ||
* - ``--only-server=<server>`` | ||
- Fetch rocks/rockspecs from this server only | ||
(overrides any entries in the config file) | ||
* - ``--only-sources=<url>`` | ||
- Restrict downloads to paths matching the given URL | ||
* - ``--lua-dir=<prefix>`` | ||
- Specify which Lua installation to use | ||
* - ``--lua-version=<ver>`` | ||
- Specify which Lua version to use | ||
* - ``--tree=<tree>`` | ||
- Specify which tree to operate on | ||
* - ``--local`` | ||
- Use the tree in the user's home directory. | ||
Call ``tt rocks help path`` to learn how to enable it | ||
* - ``--global`` | ||
- Use the system tree when `local_by_default` is `true` | ||
* - ``--verbose`` | ||
- Display verbose output for the command executed | ||
* - ``--timeout=<seconds>`` | ||
- Timeout on network operations, in seconds. | ||
0 means no timeout (wait forever). Default: 30 | ||
|
||
Commands | ||
-------- | ||
|
||
.. container:: table | ||
|
||
.. list-table:: | ||
:widths: 20 80 | ||
:header-rows: 0 | ||
|
||
* - ``build`` | ||
- Build and compile a rock | ||
* - ``config`` | ||
- Query information about the LuaRocks configuration | ||
* - ``doc`` | ||
- Show documentation for an installed rock | ||
* - ``download`` | ||
- Download a specific rock file from a rocks server | ||
* - ``help`` | ||
- Help on commands. Type ``tt rocks help <command>`` for more | ||
* - ``init`` | ||
- Initialize a directory for a Lua project using LuaRocks | ||
* - ``install`` | ||
- Install a rock | ||
* - ``lint`` | ||
- Check syntax of a rockspec | ||
* - ``list`` | ||
- List the currently installed rocks | ||
* - ``make`` | ||
- Compile package in the current directory using a rockspec | ||
* - ``make_manifest`` | ||
- Compile a manifest file for a repository | ||
* - ``new_version`` | ||
- Auto-write a rockspec for a new version of a rock | ||
* - ``pack`` | ||
- Create a rock, packing sources or binaries | ||
* - ``purge`` | ||
- Remove all installed rocks from a tree | ||
* - ``remove`` | ||
- Uninstall a rock | ||
* - ``search`` | ||
- Query the LuaRocks servers | ||
* - ``show`` | ||
- Show information about an installed rock | ||
* - ``test`` | ||
- Run the test suite in the current directory | ||
* - ``unpack`` | ||
- Unpack the contents of a rock | ||
* - ``which`` | ||
- Tell which file corresponds to a given module name | ||
* - ``write_rockspec`` | ||
- Write a template for a rockspec file | ||
|
||
Examples | ||
-------- | ||
|
||
* Install the rock ``queue`` from the Tarantool rocks repository: | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks install queue | ||
|
||
* Search for the rock ``queue`` in **both** the Tarantool rocks repository and | ||
the `default LuaRocks repository <https://luarocks.org>`_: | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks search queue --server='https://luarocks.org' | ||
|
||
* List the documentation files for the installed rock ``queue``: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. also |
||
|
||
.. code-block:: bash | ||
|
||
tt rocks doc queue --list | ||
|
||
Without the ``--list`` flag, this command displays documentation in the user's default browser. | ||
|
||
* Create a ``*.rock`` file from the installed rock ``queue``: | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks pack queue | ||
|
||
* Unpack a ``*.rock`` file: | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks unpack queue-scm-1.all.rock | ||
|
||
* Remove the installed rock ``queue``: | ||
|
||
.. code-block:: bash | ||
|
||
tt rocks remove queue | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.