Skip to content
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

Update dump-restore docs #11743

Merged
merged 23 commits into from
Dec 20, 2024
Merged
Show file tree
Hide file tree
Changes from 21 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ The `tools dump` command dumps the database data and objects schema to the clien

`--save-partial-result`: Don't delete the result of partial dumping. Without this option, the dumps that terminated with an error are deleted.

`--preserve-pool-kinds`: If this option is enabled, `tools dump` command saves storage device types specified for column groups of the tables to the dump (see `DATA` parameter in [Column groups](https://ydb.tech/docs/en/yql/reference/syntax/create_table/family) for the reference). To import such a dump, same [storage pools](https://ydb.tech/docs/en/concepts/glossary#storage-pool) must be present in the database. If at least one storage pool is missing, the import procedure will end with an error. By default this option is disabled, and the import procedure will use the default storage pool that was specified at the moment of database creation (see [Creating a database](https://ydb.tech/docs/en/devops/manual/initial-deployment#create-db) for the reference).
s-sabitova marked this conversation as resolved.
Show resolved Hide resolved

`--ordered`: Rows in the exported tables will be sorted by the primary key.

## Examples
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ To import data to the table, use the [YQL `REPLACE` command](../../../../yql/ref

`--save-partial-result`: Save the partial import result. If disabled, an import error results in reverting to the database state before the import.

`--import-data`: Use ImportData – a more efficient way to upload data than the default one. This method sends data to the server partitioned by client and in a lighter format. However, it will return an error when attempting to restore into an existing table that already has secondary indexes or is in the process of building them. Therefore, if you need to restore a table with secondary indexes, make sure they're not already present in the scheme (for example, using [`ydb scheme ls`](https://ydb.tech/docs/en/reference/ydb-cli/commands/scheme-ls) command). By default ImportData is disabled.
s-sabitova marked this conversation as resolved.
Show resolved Hide resolved

### Workload restriction parameters {#limiters}

Using the below parameters, you can limit the import workload against the database.
Expand All @@ -43,11 +45,11 @@ Some of the below parameters have default values. This means that the workload w

{% endnote %}

`--bandwidth VAL`: Limit the workload per second, defaults to 0 (not set). `VAL` specifies the data amount with a unit, for example, 2MiB.
`--rps VAL`: Limits the number of queries used to upload batches to the database per second, the default value is 30.
`--in-flight VAL`: Limits the number of queries that can be run in parallel, the default value is 10.
`--bandwidth VAL`: Limit the workload per second, defaults to 0 (not set). `VAL` specifies the data amount with a unit, for example, 2MiB. If this value is set, the `--rps` limit (see above) is not applied.
`--in-flight VAL`: Limits the number of queries that can be run in parallel, the default value is 10. To achieve maximum parallelism, set the parameter value to the number of cores allocated for the restore process.
`--upload-batch-rows VAL`: Limits the number of records in the uploaded batch, the default value is 0 (unlimited). `VAL` determines the number of records and is set as a number with an optional unit, for example, 1K.
`--upload-batch-bytes VAL`: Limits the batch of uploaded data, the default value is 512KB. `VAL` specifies the data amount with a unit, for example, 1MiB.
`--upload-batch-bytes VAL`: Limits the batch size of uploaded data, the default value is 512KB. `VAL` specifies the data amount with a unit, for example, 1MiB. Maximum value is 16 MiB.
`--upload-batch-rus VAL`: Applies only to Serverless databases to limit Request Units (RU) that can be consumed to upload one batch, defaults to 30 RU. The batch size is selected to match the specified value. `VAL` determines the number of RU and is set as a number with an optional unit, for example, 100 or 1K.

## Examples {#examples}
Expand Down Expand Up @@ -87,3 +89,9 @@ Matching schemas between the database and file system:
```bash
{{ ydb-cli }} -p quickstart tools restore -p dir1/dir2 -i ~/backup_quickstart --dry-run
```

### Example options for better performance

```bash
{{ ydb-cli }} -p quickstart tools restore -p . -i . --import-data --bandwidth=10GiB --in-flight=16 --upload-batch-bytes=16MiB
```
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@

`--save-partial-result`: Не удалять результат частично выполненной выгрузки. Без включения данной опции результат выгрузки будет удален, если в процессе её выполнения произойдет ошибка.

`--preserve-pool-kinds`: Если эта опция активна, в дамп будут сохранены имена типов устройств хранения, заданные для групп колонок таблиц (см. параметр `DATA` в статье [Группы колонок](https://ydb.tech/docs/ru/yql/reference/syntax/create_table/family)). Если при восстановлении данных в базе не окажется [пулов хранения](https://ydb.tech/docs/ru/concepts/glossary#storage-poolhttps://ydb.tech/docs/ru/concepts/glossary#storage-pool) с указанными именами, восстановление завершится ошибкой. По умолчанию данная опция деактивирована и при восстановлении используется пул хранения, заданный для базы данных при ее создании (см. [Создание базы данных](https://ydb.tech/docs/ru/devops/manual/initial-deployment#create-db)).

`--ordered`: Строки в выгруженных таблицах будут отсортированы по первичному ключу.

## Примеры
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@

`--save-partial-result`: Сохранять результат неполной загрузки. Без включения данной опции ошибка в процессе выполнения загрузки приведет к восстановлению состояния базы данных на момент перед началом загрузки.

`--import-data`: Использовать ImportData – более эффективный способ загрузки данных, чем применяется по умолчанию. Этот способ передает на сервер данные, нужным образом разделённые на партиции, и в более легковесном формате. Однако ImportData вернёт ошибку при попытке импорта таблицы, имеющей вторичные индексы или находящейся в процессе их построения, в существующую таблицу. Поэтому перед импортом таблицы со вторичными индексами необходимо убедиться в том, что они отсутствуют в схеме (например, используя команду [`ydb scheme ls`](https://ydb.tech/docs/ru/reference/ydb-cli/commands/scheme-ls)). По умолчанию ImportData не используется.

### Параметры ограничения нагрузки {#limiters}

Приведенные ниже параметры позволяют ограничить нагрузку на базу данных, создаваемую в процессе загрузки данных.
Expand All @@ -43,11 +45,11 @@

{% endnote %}

`--bandwidth VAL`: Ограничение объема загрузки в секунду, по умолчанию 0 (не установлено). `VAL` определяет объем, задается в виде числа с приставкой, например 2MiB.
`--rps VAL`: Ограничение количества запросов на загрузку пакетов данных в базу данных в секунду, по умолчанию 30.
`--in-flight VAL`: Ограничения количество запросов, одновременно находящихся в состоянии исполнения, по умолчанию 10.
`--bandwidth VAL`: Ограничение объема загрузки в секунду, по умолчанию 0 (не установлено). `VAL` определяет объем, задается в виде числа с приставкой, например 2MiB. Если определено значение `--bandwidth` ограничение на `--rps` (см. выше) не применяется.
`--in-flight VAL`: Ограничения количество запросов, одновременно находящихся в состоянии исполнения, по умолчанию 10. Для достижения максимального параллелизма следует использовать значение, равное количеству ядер процессора, отведённых под операцию восстановления.
`--upload-batch-rows VAL`: Ограничение количества записей в пакете загружаемых данных, по умолчанию 0 (не ограничено). `VAL` определяет количество записей, задается в виде числа с необязательной десятичной приставкой, например 1K.
`--upload-batch-bytes VAL`: Ограничение объема пакета загружаемых данных, по умолчанию 512KB. `VAL` определяет объем, задается в виде числа с приставкой, например 1MiB.
`--upload-batch-bytes VAL`: Ограничение объема пакета загружаемых данных, по умолчанию 512KB. `VAL` определяет объем, задается в виде числа с приставкой, например 1MiB. Максимальное значение — 16MiB.
`--upload-batch-rus VAL`: Применимо только для Serverless баз данных, ограничивает потребление Request Units (RU) на загрузку одного пакета, по умолчанию 30 RU. Размер пакета подбирается под указанное значение. `VAL` определяет количество RU, задается в виде числа с необязательной десятичной приставкой, например 100 или 1K.

## Примеры {#examples}
Expand Down Expand Up @@ -87,3 +89,9 @@
```bash
{{ ydb-cli }} -p quickstart tools restore -p dir1/dir2 -i ~/backup_quickstart --dry-run
```

### Пример вызова команды для оптимизации скорости загрузки

```bash
{{ ydb-cli }} -p quickstart tools restore -p . -i . --import-data --bandwidth=10GiB --in-flight=16 --upload-batch-bytes=16MiB
```
Loading