Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .github/workflows/nightly_dumps.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ jobs:

clt_test_mysqldump_mariadb_versions:
name: Testing supported MariaDB mysqldump versions
# Pull requests run the same matrix on their own build in test.yml.
if: github.event_name != 'pull_request'
runs-on: ubuntu-22.04
timeout-minutes: 30
steps:
Expand Down
48 changes: 48 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
source: ${{ steps.detect.outputs.source }}
test: ${{ steps.detect.outputs.test }}
clt: ${{ steps.detect.outputs.clt }}
mariadb_dump: ${{ steps.detect.outputs.mariadb_dump }}
changes_detected: ${{ steps.calc.outputs.changes_detected }} # any relevant change (source/test/clt)
skip_builds: ${{ steps.calc.outputs.skip_builds }} # only CLT tests changed and cached test-kit image exists
run_builds: ${{ steps.calc.outputs.run_builds }} # build/ubertest jobs
Expand Down Expand Up @@ -219,6 +220,15 @@ jobs:
fh.write(f"source={'true' if source else 'false'}\n")
fh.write(f"test={'true' if test else 'false'}\n")
fh.write(f"clt={'true' if clt else 'false'}\n")
mariadb_dump = any(
p == "__force_all__"
or p.startswith(("src/sphinxql", "src/searchdsql", "test/clt-tests/mysqldump/versions/mariadb/"))
or p in ("test/clt-tests/scripts/generate-records.sh",
"test/clt-tests/base/dind/init.recb",
".github/workflows/test.yml", ".github/workflows/nightly_dumps.yml")
for p in files
)
fh.write(f"mariadb_dump={'true' if mariadb_dump else 'false'}\n")
PY
- name: Finalize MCL detection
id: mcl_detect
Expand Down Expand Up @@ -991,6 +1001,36 @@ jobs:
repository: ${{ github.repository }}
ref: ${{ github.sha }}

mariadb_dump:
name: MariaDB dump and restore (candidate image)
needs: [meta, test_kit_docker_build, test_kit_docker_reuse]
if: always() && needs.meta.outputs.mariadb_dump == 'true' && (needs.test_kit_docker_build.result == 'success' || needs.test_kit_docker_reuse.result == 'success')
runs-on: ubuntu-22.04
timeout-minutes: 30
env:
MANTICORE_DUMP_IMAGE: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork && 'test-kit:img' || needs.test_kit_docker_build.outputs.candidate_image || needs.test_kit_docker_reuse.outputs.candidate_image }}
steps:
- uses: actions/checkout@v5
- name: Prepare candidate image directory
run: |
test -n "$MANTICORE_DUMP_IMAGE"
mkdir -p "${{ runner.temp }}/mariadb-candidate"
- name: Download candidate image for fork PRs
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
uses: actions/download-artifact@v7
with:
name: manticore_test_kit.img
path: ${{ runner.temp }}/mariadb-candidate
- name: Unpack candidate image for fork PRs
if: github.event_name == 'pull_request' && github.event.pull_request.head.repo.fork
run: tar -xf "${{ runner.temp }}/mariadb-candidate/artifact.tar" -C "${{ runner.temp }}/mariadb-candidate"
- uses: manticoresoftware/clt@0.7.9
with:
image: manticoresearch/dind:v1
test_prefix: test/clt-tests/mysqldump/versions/mariadb/
run_args: --privileged -e MANTICORE_DUMP_IMAGE -v $(pwd)/manual:/manual -v ${{ runner.temp }}/mariadb-candidate:/candidate:ro
ui_host: "https://clt.manticoresearch.com"

test_kit_docker_push:
# A skip_clt tag is an intentional CLT bypass; it must not block an otherwise validated image update.
if: >-
Expand Down Expand Up @@ -1207,6 +1247,7 @@ jobs:
- build_freebsd
- build_aarch64
- clt
- mariadb_dump
- meta
if: always()
runs-on: ubuntu-22.04
Expand Down Expand Up @@ -1287,6 +1328,13 @@ jobs:
failed=1
fi
fi
if [[ "${{ needs.meta.outputs.mariadb_dump }}" == "true" ]]; then
echo "* mariadb_dump: ${{ needs.mariadb_dump.result }}" >> "$GITHUB_STEP_SUMMARY"
if [[ "${{ needs.mariadb_dump.result }}" != "success" ]]; then
echo "mariadb_dump: required but result was ${{ needs.mariadb_dump.result }}"
failed=1
fi
fi
if [[ "${{ needs.meta.outputs.run_builds }}" == "true" ]]; then
if [[ "${{ needs.test_kit_light_docker_build.result }}" != "success" ]]; then
echo "test_kit_light_docker_build: required but result was ${{ needs.test_kit_light_docker_build.result }}"
Expand Down
2 changes: 1 addition & 1 deletion manual/chinese/References.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ spelldump [options] <dictionary> <affix> [result] [locale-name]
当前在Manticore SQL语法中保留的关键字的完整字母顺序列表(因此不能用作标识符)。

```
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SYSFILTERS, TOKEN, TRUE
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SQL_NO_CACHE, SYSFILTERS, TOKEN, TRUE
```

## 旧版本Manticore文档
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Manticore config

## 使用 mysqldump 备份和恢复

Manticore 支持 MySQL 26.10 及更早版本的 `mysqldump` 工具,以及 MariaDB 13.0 及更早版本的 `mariadb-dump` 工具。
Manticore 支持 MySQL 的 `mysqldump` 客户端,最高支持 26.10;同时支持 MariaDB 的 `mariadb-dump` 客户端,最高支持 13.1。

<!-- example mysqldump_backup -->

Expand All @@ -378,11 +378,13 @@ Manticore 支持 MySQL 26.10 及更早版本的 `mysqldump` 工具,以及 Mari
<!-- request Basic -->
```bash
mysqldump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump --compatible=no_key_options -h0 -P9306 manticore > manticore_backup.sql
```

执行此命令将生成名为 `manticore_backup.sql` 的备份文件。该文件包含所有数据和表结构。

将 `--compatible=no_key_options` 与 `mariadb-dump` 一起使用,以确保备份可以在 Manticore 中恢复。使用 `mariadb-dump` 13.1 时必须指定此选项。

<!-- request Replace mode -->
```bash
mysqldump -h0 -P9306 --replace --net-buffer-length=16m -etc manticore tbl > tbl.sql
Expand All @@ -393,7 +395,7 @@ mysqldump -h0 -P9306 --replace --net-buffer-length=16m -etc manticore tbl > tbl.
<!-- request Replication mode -->
```bash
mysqldump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump --compatible=no_key_options -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
```

在这种情况下,`mysqldump` 会生成诸如 `REPLACE INTO cluster:table ...` 的命令,这些命令会直接发送到 Manticore 实例,从而重新插入文档。
Expand All @@ -403,7 +405,7 @@ mariadb-dump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cl

要将已更改的全文设置应用到现有文档,请参见[在更改 FT 设置后重新索引现有文档](../Updating_table_schema_and_settings.md#Reindexing-existing-documents-after-changing-FT-settings)。

当将转储直接通过管道输入 `mysql` 以重新索引同一张表时,必须使用 `--skip-lock-tables`。如果是导出到文件并在 `mysqldump` 退出后再回放,则不需要。
将转储直接通过管道传递给 `mysql` 以重新索引同一个表时,必须指定 `--skip-lock-tables`。通常,将数据导出到文件并在 `mysqldump` 退出后重新执行时,无需指定此选项。

<!-- example mysqldump_restore -->
### 恢复
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ SHOW TABLE `foo` STATUS LIKE 'locked';
<!-- example lock -->

```sql
lock tables tbl1 read[, tbl2 read, ...]
lock tables tbl1 read [local][, tbl2 read [local], ...]
```

你可以在 SQL 客户端会话中显式锁定表,以便与其他会话协调访问,或者在你需要独占访问时阻止其他会话修改数据。一个会话只能为自己锁定或解锁表,不能代替其他会话进行锁定或解锁。锁只能在通过 MySQL 协议连接的 SQL 会话中使用。表被锁定时,任何协议都不能修改其数据(SQL / HTTP / binary)。锁也不适用于属于复制集群的表。


Manticore 只支持 **读(共享)** 锁,不支持 **写(独占)** 锁。
Manticore 仅支持 **读取(共享)** 锁。为兼容 MySQL/MariaDB 客户端,`READ LOCAL` 按 `READ` 处理:锁持有期间不允许并发写入。不支持 **写入(排他)** 锁。

当会话请求读锁时,Manticore 会:
1. 检查连接是否使用 MySQL 协议。
Expand Down
2 changes: 1 addition & 1 deletion manual/english/References.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ spelldump [options] <dictionary> <affix> [result] [locale-name]
A comprehensive alphabetical list of keywords currently reserved in Manticore SQL syntax (thus, they cannot be used as identifiers).

```
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SYSFILTERS, TOKEN, TRUE
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SQL_NO_CACHE, SYSFILTERS, TOKEN, TRUE
```

## Documentation for old Manticore versions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Manticore config

## Backup and restore with mysqldump

Manticore supports `mysqldump` utility from MySQL up to 26.10 and `mariadb-dump` utility from MariaDB up to 13.0.
Manticore supports the `mysqldump` client from MySQL up to 26.10 and the `mariadb-dump` client from MariaDB up to 13.1.

<!-- example mysqldump_backup -->

Expand All @@ -378,11 +378,13 @@ Note, `mysqldump` is supported only for real-time tables.
<!-- request Basic -->
```bash
mysqldump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump --compatible=no_key_options -h0 -P9306 manticore > manticore_backup.sql
```

Executing this command will produce a backup file named `manticore_backup.sql`. This file will hold all data and table schemas.

Use `--compatible=no_key_options` with `mariadb-dump` to make sure the backup can be restored in Manticore. This option is required with `mariadb-dump` 13.1.

<!-- request Replace mode -->
```bash
mysqldump -h0 -P9306 --replace --net-buffer-length=16m -etc manticore tbl > tbl.sql
Expand All @@ -393,7 +395,7 @@ This will produce a backup file `tbl.sql` with `replace` commands instead of `in
<!-- request Replication mode -->
```bash
mysqldump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump --compatible=no_key_options -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
```

In this case, `mysqldump` will generate commands like `REPLACE INTO cluster:table ...`, which will be sent directly to the Manticore instance, resulting in the documents being reinserted.
Expand All @@ -403,7 +405,7 @@ Use the `cluster` user and the `-t` flag to enable replication mode. See the det

To apply changed full-text settings to existing documents, see [Reindexing existing documents after changing FT settings](../Updating_table_schema_and_settings.md#Reindexing-existing-documents-after-changing-FT-settings).

When piping a dump directly into `mysql` to reindex the same table, `--skip-lock-tables` is required. It is not required when exporting to a file and replaying it after `mysqldump` exits.
When piping a dump directly into `mysql` to reindex the same table, `--skip-lock-tables` is required. It is normally not required when exporting to a file and replaying it after `mysqldump` exits.

<!-- example mysqldump_restore -->
### Restore
Expand Down
4 changes: 2 additions & 2 deletions manual/english/Securing_and_compacting_a_table/Freezing_and_locking_a_table.md
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -124,13 +124,13 @@ SHOW TABLE `foo` STATUS LIKE 'locked';
<!-- example lock -->

```sql
lock tables tbl1 read[, tbl2 read, ...]
lock tables tbl1 read [local][, tbl2 read [local], ...]
```

You can explicitly lock tables in an SQL client session to coordinate access with other sessions or to stop other sessions from changing data while you need exclusive access. A session can only lock or unlock tables for itself. It cannot lock or unlock tables on behalf of another session. Locks can be used only in SQL sessions connected through the MySQL protocol. While a table is locked, no protocol is allowed to change its data (SQL / HTTP / binary). Locks also don't work for tables that belong to a replication cluster.


Manticore supports only **read (shared)** locks. **Write (exclusive)** locks are not supported.
Manticore supports only **read (shared)** locks. `READ LOCAL` is treated as `READ` for MySQL/MariaDB client compatibility: concurrent writes are not allowed while the lock is held. **Write (exclusive)** locks are not supported.

When a session requests a read lock, Manticore:
1. Checks that the connection uses the MySQL protocol.
Expand Down
2 changes: 1 addition & 1 deletion manual/russian/References.md
Original file line number Diff line number Diff line change
Expand Up @@ -643,7 +643,7 @@ spelldump [options] <dictionary> <affix> [result] [locale-name]
Полный алфавитный список ключевых слов, в настоящее время зарезервированных в синтаксисе Manticore SQL (поэтому их нельзя использовать как идентификаторы).

```
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SYSFILTERS, TOKEN, TRUE
AND, AS, BY, COLUMNARSCAN, DISTINCT, DIV, DOCIDINDEX, EXPLAIN, FACET, FALSE, FORCE, FROM, HYBRID_MATCH, IGNORE, IN, INDEXES, INNER, IS, JOIN, KNN, LEFT, LIMIT, MOD, NOT, NO_COLUMNARSCAN, NO_DOCIDINDEX, NO_SECONDARYINDEX, NULL, OFFSET, ON, OR, ORDER, RELOAD, SECONDARYINDEX, SELECT, SQL_NO_CACHE, SYSFILTERS, TOKEN, TRUE
```

## Документация по старым версиям Manticore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ Manticore config

## Резервное копирование и восстановление с помощью mysqldump

Manticore поддерживает утилиту `mysqldump` из MySQL до версии 26.10 включительно и утилиту `mariadb-dump` из MariaDB до версии 13.0 включительно.
Manticore поддерживает клиент `mysqldump` из MySQL до версии 26.10 и клиент `mariadb-dump` из MariaDB до версии 13.1.

<!-- example mysqldump_backup -->

Expand All @@ -378,11 +378,13 @@ Manticore поддерживает утилиту `mysqldump` из MySQL до в
<!-- request Basic -->
```bash
mysqldump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump -h0 -P9306 manticore > manticore_backup.sql
mariadb-dump --compatible=no_key_options -h0 -P9306 manticore > manticore_backup.sql
```

Выполнение этой команды создаст файл резервной копии с именем `manticore_backup.sql`. Этот файл будет содержать все данные и схемы таблиц.

Используйте `--compatible=no_key_options` с `mariadb-dump`, чтобы гарантировать возможность восстановления резервной копии в Manticore. Этот параметр обязателен для `mariadb-dump` 13.1.

<!-- request Replace mode -->
```bash
mysqldump -h0 -P9306 --replace --net-buffer-length=16m -etc manticore tbl > tbl.sql
Expand All @@ -393,7 +395,7 @@ mysqldump -h0 -P9306 --replace --net-buffer-length=16m -etc manticore tbl > tbl.
<!-- request Replication mode -->
```bash
mysqldump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
mariadb-dump --compatible=no_key_options -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cluster:tbl | mysql -P9306 -h0
```

В этом случае `mysqldump` сгенерирует команды вида `REPLACE INTO cluster:table ...`, которые будут напрямую отправлены в экземпляр Manticore, в результате чего документы будут повторно вставлены.
Expand All @@ -403,7 +405,7 @@ mariadb-dump -etc --replace -h0 -P9306 -ucluster manticore --skip-lock-tables cl

Чтобы применить изменённые настройки полнотекстового поиска к существующим документам, см. [Переиндексация существующих документов после изменения настроек FT](../Updating_table_schema_and_settings.md#Reindexing-existing-documents-after-changing-FT-settings).

При прямой передаче дампа в `mysql` для переиндексации той же таблицы требуется `--skip-lock-tables`. При экспорте в файл и последующем воспроизведении после выхода `mysqldump` это не требуется.
При передаче дампа напрямую в `mysql` для переиндексации той же таблицы параметр `--skip-lock-tables` обязателен. Обычно он не требуется при экспорте в файл и последующем выполнении дампа после завершения работы `mysqldump`.

<!-- example mysqldump_restore -->
### Восстановление
Expand Down
Loading
Loading