Upgrade to v1.8
MygramDB v1.8.1 is a correctness and reliability release in the v1.8 line. It has no breaking API changes, but one default changed in v1.8.0: if ngram_size is omitted, the default is now 2 instead of 1.
Most upgrades are straightforward. Check your configuration for assumed defaults, HTTP clients that need boolean expressions, and automation that starts SYNC while another maintenance task is running.
What Changed
Default ngram_size
The global default ngram_size is now 2 for ASCII/alphanumeric text. This matches the recommended bigram configuration used throughout the docs.
If you intentionally relied on the previous unigram default, set it explicitly:
tables:
- name: "articles"
ngram_size: 1
text_source:
column: "content"For typical English or mixed-language content, prefer:
tables:
- name: "articles"
ngram_size: 2
kanji_ngram_size: 1Config validation
ENUM and SET are now rejected as configured filter types, because binlog row events do not carry the labels needed to keep initial load and replication semantics identical. auto_initial_snapshot: true also requires start_from: "snapshot" in single-table deployments as well as multi-table deployments.
Replication correctness fixes
v1.8.0 fixes several replication edge cases:
- A filter-only
UPDATEcould remove still-qualifying rows from search results. - A primary-key-changing
UPDATEcould leave stale indexed rows. - Unsafe binlog states now fail fast.
Query and HTTP behavior
HTTP q is literal search text by default. Request options use JSON fields such as limit, offset, sort, filters, highlight, and fuzzy. Set "mode": "boolean" when q is an intentional boolean expression. During table synchronization, HTTP search/count/facet/get requests return 503 instead of racing the in-flight rebuild.
This means clients should send intent as structured JSON rather than as a command string:
{
"q": "quantum physics",
"mode": "literal",
"limit": 20,
"sort": { "column": "created_at", "order": "DESC" },
"filters": { "status": 1 }
}Boolean queries gained fixes for:
- short terms under bigram indexing
- quoted phrases containing
AND/OR/NOT - the
<>not-equal filter operator - raw boolean query parsing in client libraries
v1.8.1 reliability changes
| Area | Change |
|---|---|
| Filter columns | Boolean filter columns are supported. |
| Dump restore | V2 dump restore has bounded limits that you can configure. |
| C client | The client configuration is size- and version-tagged, and adds Unix-socket and asynchronous DUMP SAVE timeout settings. |
| HTTP allowlist | The CIDR check fails closed: only /health/live and /health/ready bypass it. |
| Date/time parsing | Date-only strings such as 2024-01-15 are accepted. Fractional epoch seconds are truncated to whole seconds. |
SYNC | Rejected while OPTIMIZE, DUMP SAVE, or DUMP LOAD is in progress. Retry after the operation completes. |
CLI DOC output | Escaped values such as \n, \t, \\, \", and \xHH are decoded instead of printed verbatim. |
| Incompatible DDL | A DROP, RENAME, or semantic change to a configured primary-key, text-source, or filter column stops replication before its GTID advances. Fix the schema or configuration, then run SYNC to rebuild the affected table. |
Upgrade Checklist
- Review table configs that omit
ngram_size. - Set
ngram_size: 1explicitly only if you require the old unigram behavior. - Check that no configured filter uses
ENUMorSET. - If
auto_initial_snapshot: trueis enabled, make surestart_from: "snapshot"is set. - Keep HTTP search options in JSON fields. Add
"mode": "boolean"only for intentional boolean expressions. - Expect temporary
503responses from table read endpoints duringSYNC; retry after readiness returns healthy. - After changing configured columns, confirm replication remains healthy; if it stopped for an incompatible DDL change, fix it and run
SYNC. - Run your usual search and replication smoke tests after upgrade.
Full release notes are available in the v1.8.1 release document.