Skip to content
This repository has been archived by the owner on Mar 21, 2024. It is now read-only.

Merge snapshot options #214

Merged
merged 3 commits into from
Feb 6, 2023
Merged
Show file tree
Hide file tree
Changes from 2 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
6 changes: 2 additions & 4 deletions text/0034-telemetry-policies.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,8 @@ The collected data is sent to [Segment](https://segment.com/). Segment is a plat
| `infos.ignore_missing_dump` | `true` if `--ignore-missing-dump` is specified to true, otherwise `false` | true | Every Hour |
| `infos.ignore_dump_if_db_exists` | `true` if `--ignore-dump-if-db-exists` is specified to true, otherwise `false` | true | Every Hour |
| `infos.import_snapshot` | `true` if `--import-snapshot` is specified, otherwise `false` | true | Every Hour |
| `infos.schedule_snapshot` | `true` if `--schedule_snapshot`/`MEILI_SCHEDULE_SNAPSHOT` is specified to true, otherwise `false` | true | Every hour |
| `infos.schedule_snapshot` | Value of `--schedule_snapshot`/`MEILI_SCHEDULE_SNAPSHOT` if scheduled snapshots are enabled, otherwise `None` | 86400 | Every hour |
gmourier marked this conversation as resolved.
Show resolved Hide resolved
| `infos.snapshot_dir` | `true` if `--snapshot-dir`/`MEILI_SNAPSHOT_DIR` is specified to true, otherwise `false` | true | Every Hour |
| `infos.snapshot_interval_sec` | Value of `--snapshot_interval_sec`/`MEILI_SNAPSHOT_INTERVAL_SEC` in seconds | 86400 | Every Hour |
| `infos.ignore_missing_snapshot` | `true` if `--ignore_missing_snapshot` is specified to true, otherwise `false` | true | Every Hour |
| `infos.ignore_snapshot_if_db_exists` | `true` if `--ignore_snapshot_if_db_exists` is specified to true, otherwise `false` | true | Every Hour |
| `infos.http_addr` | `true` if `--http-addr`/`MEILI_HTTP_ADDR` is specified, otherwise `false` | true| Every Hour |
Expand Down Expand Up @@ -208,9 +207,8 @@ This property allows us to gather essential information to better understand on
| infos.ignore_missing_dump | `true` if `--ignore-missing-dump` is specified to true, otherwise `false` | `true` |
| infos.ignore_dump_if_db_exists | `true` if `--ignore-dump-if-db-exists` is specified to true, otherwise `false` | `true` |
| infos.import_snapshot | `true` if `--import-snapshot` is specified, otherwise `false` | `true` |
| infos.schedule_snapshot | `true` if `--schedule-snapshot`/`MEILI_SCHEDULE_SNAPSHOT` is specified to true, otherwise `false` | `true` |
| infos.schedule_snapshot | Value of `--schedule_snapshot`/`MEILI_SCHEDULE_SNAPSHOT` if scheduled snapshots are enabled, otherwise `None` | `86400` |
| infos.snapshot_dir | `true` if `--snapshot-dir`/`MEILI_SNAPSHOT_DIR` is specified to true, otherwise `false` | `true` |
| infos.snapshot_interval_sec | Value of `--snapshot-interval-sec`/`MEILI_SNAPSHOT_INTERVAL_SEC` in seconds | `86400` |
| infos.ignore_missing_snapshot | `true` if `--ignore-missing-snapshot` is specified to true, otherwise `false` | `true` |
| infos.ignore_snapshot_if_db_exists | `true` if `--ignore-snapshot-if-db-exists` is specified to true, otherwise `false` | `true` |
| infos.http_addr | `true` if `--http-addr`/`MEILI_HTTP_ADDR` is specified, otherwise `false` | `true`|
Expand Down
87 changes: 40 additions & 47 deletions text/0119-instance-options.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,10 @@ Command-line options take precedence over environment variables. If the same con

The options that do not expect any value when using the command-line option accepts the following value when using the corresponding environment variable: `n`, `no`, `f`, `false`, `off`, and `0` as `false`. An absent environment variable will also be considered as `false`. Everything else is considered `true`.

Example with the snapshort creation:
- `export MEILI_SCHEDULE_SNAPSHOT=yes` means the snapshot creation is enabled.
- `export MEILI_SCHEDULE_SNAPSHOT=off` means the snapshot creation is disabled.
- No variable set means the snapshot creation is disabled.
Example with the option to make SSL mandatory:
- `export MEILI_SSL_REQUIRE_AUTH=yes` means that mandatory SSL is enabled.
- `export MEILI_SSL_REQUIRE_AUTH=off` means that mandatory SSL is disabled.
- No variable set means that mandatory SSL is disabled.

### 3.2. Error behavior

Expand All @@ -76,15 +76,15 @@ error: The argument '--db-path <DB_PATH>' requires a value but none was supplied
❌ Wrong

```bash
./meilisearch --schedule-snapshot yes
./meilisearch --ssl-require-auth yes

error: Found argument 'yes' which wasn't expected, or isn't valid in this context
```

✅ Correct

```bash
./meilisearch --schedule-snapshot
./meilisearch --ssl-require-auth
```

The expected behavior of each flag is described in the list above.
Expand All @@ -106,21 +106,20 @@ The expected behavior of each flag is described in the list above.
- [Payload limit size](#3313-payload-limit-size)
- [Schedule snapshot creation](#3314-schedule-snapshot-creation)
- [Snapshot destination](#3315-snapshot-destination)
- [Snapshot interval](#3316-snapshot-interval)
- [Import snapshot](#3317-import-snapshot)
- [Ignore missing snapshot](#3318-ignore-missing-snapshot)
- [Ignore snapshot if DB exists](#3319-ignore-snapshot-if-db-exists)
- [Max memory usage when indexing](#3320-max-memory-usage-when-indexing)
- [Max indexing threads](#3321-max-indexing-threads)
- [Disable auto-batching](#3322-disable-auto-batching)
- [SSL authentication path](#3323-ssl-authentication-path)
- [SSL certificates path](#3324-ssl-certificates-path)
- [SSL key path](#3325-ssl-key-path)
- [SSL OCSP path](#3326-ssl-ocsp-path)
- [SSL require auth](#3327-ssl-require-auth)
- [SSL resumption](#3328-ssl-resumption)
- [SSL tickets](#3329-ssl-tickets)
- [Config file path](#3330-config-file-path)
- [Import snapshot](#3316-import-snapshot)
- [Ignore missing snapshot](#3317-ignore-missing-snapshot)
- [Ignore snapshot if DB exists](#3318-ignore-snapshot-if-db-exists)
- [Max memory usage when indexing](#3319-max-memory-usage-when-indexing)
- [Max indexing threads](#3320-max-indexing-threads)
- [Disable auto-batching](#3321-disable-auto-batching)
- [SSL authentication path](#3322-ssl-authentication-path)
- [SSL certificates path](#3323-ssl-certificates-path)
- [SSL key path](#3324-ssl-key-path)
- [SSL OCSP path](#3325-ssl-ocsp-path)
- [SSL require auth](#3326-ssl-require-auth)
- [SSL resumption](#3327-ssl-resumption)
- [SSL tickets](#3328-ssl-tickets)
- [Config file path](#3329-config-file-path)

#### 3.3.1. Database path

Expand Down Expand Up @@ -278,11 +277,14 @@ Sets the maximum size of accepted payloads. Value must be given in bytes or expl

**Environment variable**: `MEILI_SCHEDULE_SNAPSHOT`
**CLI option**: `--schedule-snapshot`
**Default**: Disabled
**Default when absent**: Disabled
**Optional value**: an integer

⚠️ This command-line option does not take any values. Assigning a value will throw an error.
⚠️ This command-line option takes an **optional** integer value. Passing the flag with no value implies the default value of 86400.

Activates scheduled snapshots when enabled. Snapshots are disabled by default.
- Omitting the flag, not defining `MEILI_SCHEDULE_SNAPSHOT`, or specifying `schedule_snapshot=false` in the configuration file disables the scheduled snapshots, and is the default behavior.
- Passing the flag without a value or specifying `schedule_snapshot=true` in the configuration file enables the scheduled snapshot with the default interval of 86400 seconds between each snapshot.
- Passing the flag with an integer value, defining the `MEILI_SCHEDULE_SNAPSHOT` to an integer value, or specifying `schedule_snapshot=x` with `x` an integer value in the configuration file enables the scheduled snapshots with an interval between each snapshot of the specified integer value, in seconds.

#### 3.3.15. Snapshot destination

Expand All @@ -293,16 +295,7 @@ Activates scheduled snapshots when enabled. Snapshots are disabled by default.

Sets the directory where Meilisearch will store snapshots. If the directory does not exist when a snapshot is generated it will be created.

#### 3.3.16. Snapshot interval

**Environment variable**: `MEILI_SNAPSHOT_INTERVAL_SEC`
**CLI option**: `--snapshot-interval-sec`
**Default value**: `86400` (1 day)
**Expected value**: an integer

Defines the interval between each snapshot. Value must be given in seconds.

#### 3.3.17. Import snapshot
#### 3.3.16. Import snapshot

**Environment variable**: `MEILI_IMPORT_SNAPSHOT`
**CLI option**: `--import-snapshot`
Expand All @@ -318,7 +311,7 @@ This command will throw an error if:

This behavior can be modified with the `--ignore-snapshot-if-db-exists` and `--ignore-missing-snapshot` options, respectively.

#### 3.3.18. Ignore missing snapshot
#### 3.3.17. Ignore missing snapshot

**Environment variable**: `MEILI_IGNORE_MISSING_SNAPSHOT`
**CLI option**: `--ignore-missing-snapshot`
Expand All @@ -330,7 +323,7 @@ Prevents a Meilisearch instance from throwing an error when `--import-snapshot`

This command will throw an error if `--import-snapshot` is not defined.

#### 3.3.19. Ignore snapshot if DB exists
#### 3.3.18. Ignore snapshot if DB exists

**Environment variable**: `MEILI_IGNORE_SNAPSHOT_IF_DB_EXISTS`
**CLI option**: `--ignore-snapshot-if-db-exists`
Expand All @@ -342,7 +335,7 @@ Prevents a Meilisearch instance with an existing database from throwing an error

This command will throw an error if `--import-snapshot` is not defined.

#### 3.3.20. Max memory usage when indexing
#### 3.3.19. Max memory usage when indexing

**Environment variable**: `MEILI_MAX_INDEXING_MEMORY`
**CLI option**: `--max-indexing-memory`
Expand All @@ -358,7 +351,7 @@ Value must be given in bytes or explicitly stating a base unit. For example, the
- This command-line option does not perfectly ensure the RAM usage but helps you manage multiple Meilisearch engines on the same machine (for example, using Kubernetes). The search engine cannot guarantee the exact usage of the RAM.
- If the number set is higher than the real available RAM in the machine, we cannot prevent Meilisearch from crashing.

#### 3.3.21. Max indexing threads
#### 3.3.20. Max indexing threads

**Environment variable**: `MEILI_MAX_INDEXING_THREADS`
**CLI option**: `--max-indexing-threads`
Expand All @@ -374,7 +367,7 @@ Obviously, multi-threading is not possible in machines with only one processor c

If the number set is higher than the real number of core available in the machine, Meilisearch will use the maximum number of available cores.

#### 3.3.22. Disable auto-batching
#### 3.3.21. Disable auto-batching

**Environment variable**: `MEILI_DISABLE_AUTO_BATCHING`
**CLI option**: `--disable-auto-batching`
Expand All @@ -384,7 +377,7 @@ If the number set is higher than the real number of core available in the machin

Disable the [auto-batching feature](./0096-auto-batching.md).

#### 3.3.23. SSL authentication path
#### 3.3.22. SSL authentication path

**Environment variable**: `MEILI_SSL_AUTH_PATH`
**CLI option**: `--ssl-auth-path`
Expand All @@ -393,7 +386,7 @@ Disable the [auto-batching feature](./0096-auto-batching.md).

Enables client authentication in the specified path.

#### 3.3.24. SSL certificates path
#### 3.3.23. SSL certificates path

**Environment variable**: `MEILI_SSL_CERT_PATH`
**CLI option**: `--ssl-cert-path`
Expand All @@ -404,7 +397,7 @@ Sets the server's SSL certificates.

Value must be a path to PEM-formatted certificates. The first certificate should certify the KEYFILE supplied by `--ssl-key-path`. The last certificate should be a root CA.

#### 3.3.25. SSL key path
#### 3.3.24. SSL key path

**Environment variable**: `MEILI_SSL_KEY_PATH`
**CLI option**: `--ssl-key-path`
Expand All @@ -415,7 +408,7 @@ Sets the server's SSL keyfiles.

Value must be a path to an RSA private key or PKCS8-encoded private key, both in PEM format.

#### 3.3.26. SSL OCSP path
#### 3.3.25. SSL OCSP path

**Environment variable**: `MEILI_SSL_OCSP_PATH`
**CLI option**: `--ssl-ocsp-path`
Expand All @@ -426,7 +419,7 @@ Sets the server's OCSP file. *Optional*

Reads DER-encoded OCSP response from OCSPFILE and staple to certificate.

#### 3.3.27. SSL require auth
#### 3.3.26. SSL require auth

**Environment variable**: `MEILI_SSL_REQUIRE_AUTH`
**CLI option**: `--ssl-require-auth`
Expand All @@ -438,7 +431,7 @@ Makes SSL authentication mandatory.

Sends a fatal alert if the client does not complete client authentication.

#### 3.3.28. SSL resumption
#### 3.3.27. SSL resumption

**Environment variable**: `MEILI_SSL_RESUMPTION`
**CLI option**: `--ssl-resumption`
Expand All @@ -448,7 +441,7 @@ Sends a fatal alert if the client does not complete client authentication.

Activates SSL session resumption.

#### 3.3.29. SSL tickets
#### 3.3.28. SSL tickets

**Environment variable**: `MEILI_SSL_TICKETS`
**CLI option**: `--ssl-tickets`
Expand All @@ -458,7 +451,7 @@ Activates SSL session resumption.

Activates SSL tickets.

#### 3.3.30. Config file path
#### 3.3.29. Config file path

**Environment variable**: `MEILI_CONFIG_FILE_PATH`
**CLI option**: `--config-file-path`
Expand Down