docs: fold HNSW snapshots into concepts/storage for v1.39 - #492
Open
g-despot wants to merge 1 commit into
Open
Conversation
Review feedback on #475 was that the page reads as too alarmist and documents too much of the pre-v1.39 approach. Since v1.39 leaves nothing to configure, the standalone page no longer earns its own URL: its content moves into the storage concepts page and the per-variable reference stays in the env-vars table, which already carried all five variables in full. - Drop the "snapshots are now required to start" caution in favour of plain prose: checksummed blocks, the write-then-delete ordering, and the commit logs on disk being the delta since the last snapshot. - Correct the failure radius. An unreadable snapshot fails the whole shard, not just one vector index. Lazy-loaded shards leave the node up and error per request; eagerly loaded shards fail node startup, and eager is the default for single-tenant collections. - Note the disk-usage reduction on upgrade, attributed to the snapshot replacing the logs it covers rather than to a new snapshot format -- the V3 format predates v1.39. Scope it to loaded shards after the compactor's first cycles, and keep the headroom caveat, since peak usage still rises while a snapshot is written. - Delete the deprecated-env-var section, keeping the two facts that lived nowhere else: the variables are still recognised but ignored, and the equivalent camelCase fields in a --config-file are accepted silently, with no startup warning. - Collapse the pre-v1.39 configuration detail behind a <details>, with the anchor on the heading above it. Docusaurus's Details component has no hashchange handling, so an anchor inside would strand the five inbound env-var links on a collapsed summary. - Redirect the old path to the concepts anchor; the v1.31 release blog and a live kapa answer both cite it. Also fixes the long-standing broken anchor on the vector-cache env var: APITable row ids are the variable name verbatim, so the link needs upper case.
There was a problem hiding this comment.
Orca Security Scan Summary
| Status | Check | Issues by priority | |
|---|---|---|---|
| Secrets | View in Orca |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the Weaviate docs for v1.39 by removing the now-obsolete standalone “HNSW snapshots” configuration page and folding the relevant conceptual + historical (pre-v1.39) information into the Storage concepts page, while preserving compatibility via redirects and updated deep links from the env-var reference.
Changes:
- Remove the
weaviate/configuration/hnsw-snapshotspage from navigation (sidebar + configuration landing cards) and delete the standalone doc. - Expand
weaviate/concepts/storageto include the v1.39 snapshot/compaction model plus a condensed, anchored pre-v1.39 configuration section. - Update references and routing: add a Netlify redirect from the old URL and retarget env-var deep links (plus a related-page link from persistence docs).
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| sidebars.js | Removes the HNSW snapshots page from the configuration sidebar navigation. |
| netlify.toml | Adds a 301 redirect from the removed configuration URL to the new anchor on the storage concepts page. |
| docs/weaviate/configuration/index.mdx | Removes the “HNSW Snapshots” configuration card from the configuration landing page. |
| docs/weaviate/configuration/hnsw-snapshots.md | Deletes the standalone HNSW snapshots configuration page (content moved/condensed elsewhere). |
| docs/weaviate/concepts/storage.md | Incorporates HNSW snapshots content (v1.39 behavior + pre-v1.39 details under a stable anchor). |
| docs/deploy/configuration/persistence.md | Adds a related link pointing readers to the new HNSW snapshots section in storage concepts. |
| docs/deploy/configuration/env-vars/index.md | Retargets deprecated snapshot env-var rows to the new pre-v1.39 anchor on the storage concepts page. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+86
to
+90
| | `PERSISTENCE_HNSW_DISABLE_SNAPSHOTS` | **Deprecated in `v1.39`.** Ignored, and logs a startup warning. In `v1.31` through `v1.38`: if set, HNSW snapshotting is disabled. Default: `false` (enabled) as of `v1.36`; `true` (disabled) in `v1.31` through `v1.35`. See [snapshot configuration before `v1.39`](/weaviate/concepts/storage.md#pre-v1-39-configuration). <br/>Added in `v1.31` | `boolean` | `false` | | ||
| | `PERSISTENCE_HNSW_SNAPSHOT_INTERVAL_SECONDS` | **Deprecated in `v1.39`.** Ignored, and logs a startup warning. In `v1.31` through `v1.38`: the minimum time in seconds that must pass before the next snapshot is created. Default: `21600` seconds (6 hours). See [snapshot configuration before `v1.39`](/weaviate/concepts/storage.md#pre-v1-39-configuration). <br/>Added in `v1.31` | `string - number` | `3600` | | ||
| | `PERSISTENCE_HNSW_SNAPSHOT_MIN_DELTA_COMMITLOGS_NUMBER` | **Deprecated in `v1.39`.** Ignored, and logs a startup warning. In `v1.31` through `v1.38`: the minimum number of new commit log files created since the last snapshot. Default: `1`. See [snapshot configuration before `v1.39`](/weaviate/concepts/storage.md#pre-v1-39-configuration). <br/>Added in `v1.31` | `string - number` | `100` | | ||
| | `PERSISTENCE_HNSW_SNAPSHOT_MIN_DELTA_COMMITLOGS_SIZE_PERCENTAGE` | **Deprecated in `v1.39`.** Ignored, and logs a startup warning. In `v1.31` through `v1.38`: the minimum total size of new commit logs (as a percentage of the previous snapshot's size) required to trigger a new snapshot. Default: `5` (meaning 5% of the previous snapshot's size in new commit logs). See [snapshot configuration before `v1.39`](/weaviate/concepts/storage.md#pre-v1-39-configuration). <br/>Added in `v1.31` | `string - number` | `15` | | ||
| | `PERSISTENCE_HNSW_SNAPSHOT_ON_STARTUP` | **Deprecated in `v1.39`.** Ignored, and logs a startup warning. In `v1.31` through `v1.38`: if set, Weaviate tries to create a new snapshot during startup if there are changes in the commit log since the last snapshot. If there are no changes, the existing snapshot is loaded. Default: `true`. See [snapshot configuration before `v1.39`](/weaviate/concepts/storage.md#pre-v1-39-configuration). <br/>Added in `v1.31` | `boolean` | `false` | |
|
|
||
| Upgrading to `v1.39` therefore reduces the disk space the vector index uses, in some cases substantially. Earlier versions keep the full commit log alongside the snapshot, and a snapshot is a more compact representation of the same index than the commit logs it replaces, because compaction keeps only the final state of each vector's connections instead of every change made to them. | ||
|
|
||
| Two caveats apply. The saving appears once the compactor has run its first cycles on each loaded shard rather than at the moment you upgrade, and inactive tenants do not shrink until they are next activated. Keep planning for the same headroom as before, because peak disk usage still rises while a snapshot is being written. |
Comment on lines
100
to
+104
| For the HNSW vector index, the Write-Ahead-Log (WAL) is a critical component for disaster recovery and persisting the most recent changes. The cost in building up an HNSW index is in figuring out where to place a new object and how to link it with its neighbors. The WAL contains only the result of those calculations. | ||
|
|
||
| The entire HNSW index state can be reconstructed by replaying these WAL entries. | ||
|
|
||
| For very large indexes of tens or hundreds of millions of objects, this can be time-consuming. To avoid replaying the entire WAL on every restart, Weaviate writes **[HNSW snapshots](../configuration/hnsw-snapshots.md)**. | ||
| For very large indexes of tens or hundreds of millions of objects, this can be time-consuming. To avoid replaying the entire commit log on every restart, Weaviate writes **[HNSW snapshots](#hnsw-snapshots)**. |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Follow-up to #475, applying the review feedback on it.
What changed, and why the page is gone rather than moved
The feedback suggested moving
configuration/hnsw-snapshotsinto the Storage and Backups section, on the grounds that there is not much to configure now. Taking that a step further: in v1.39 there is nothing to configure at all, so the page no longer earns its own URL. Its content is folded into the storage concepts page, and the per-variable reference stays in the env-vars table — which already documented all five variables in full, defaults included, so most of the deleted page was duplicating it.Net effect: the pre-v1.39 material drops from ~40 lines of a 63-line standalone page to ~9 lines on the concepts page, half of that behind a
<details>, with no TOC entry, no sidebar entry and no card. That addresses the "documents too much the historical approach" half of the feedback, which simply relocating the page would not have.The old URL 301s to
/weaviate/concepts/storage#hnsw-snapshots. That redirect is load-bearing: the 1.31 release blog hardcodes the old path, and there is a live kapa answer citing it.The alarmist framing
The "Snapshots are now required to start" caution is replaced with plain prose covering the checksummed block format, the write-then-delete ordering, and the commit logs on disk being the delta since the last snapshot.
One correction in the other direction, though: the original text understated the blast radius. An unreadable snapshot fails the whole shard, not just the one vector index — one bad named vector aborts every vector index on that shard. Whether the node survives depends on how the shard loads, and the first draft of this PR got that backwards, so to be explicit: lazy-loaded shards leave the node up and return errors per request, eagerly loaded shards fail node startup, and eager is the default for single-tenant collections and for multi-tenant collections below the auto-detection thresholds. Being accurate here reads as less alarming than the caution box did, not more.
Are there any new env vars? — No
Checked against core on the 1.39 line. The
compactpackage reads no environment variables at all; every compactor tunable is a hardcoded Go default (MaxFilesPerMerge,SnapshotThreshold, block size, buffer sizes). The only related knob that still does anything is the pre-existingPERSISTENCE_HNSW_MAX_LOG_SIZE, which paces WAL rotation rather than configuring snapshots.Two places the suggested wording didn't survive contact with the code
Flagging these rather than burying them, since both came from the review:
"the snapshot format being more efficient than the commit logger." The V3 snapshot format predates v1.39 — the migrator moves an existing V3 snapshot byte-for-byte on upgrade. So the disk-usage win is not a new format. It is (a) no duplication, since earlier versions keep the full commit log alongside the snapshot, and (b) compaction keeping only the final state of each vector's connections rather than every change. The page now says that instead.
"the commit logs now just store the delta." True as an outcome, but there is no delta encoding. The logs a snapshot covers are deleted once it commits, and older ones are filtered out at replay, so what remains on disk is the delta. Written as the mechanism, since "the commit log format changed" would be wrong.
The disk-reduction note also carries three qualifiers, because it is not realised at the upgrade instant: it appears after the compactor's first cycles on each loaded shard, inactive tenants do not shrink until next activated, and peak usage still rises while a snapshot is being written — so it is not a reason to cut disk headroom. No numbers published.
Two changes outside the stated scope
Easy to drop if you'd rather keep the diff tight:
storage.mdvector-cache link. Fixes a broken anchor that had been reported as "pre-existing" for a while.APITablesets each row'sidto the variable name verbatim, so the link needs upper case. Worth knowing generally —onBrokenAnchorsis not configured in this repo, so wrong-case anchors warn rather than fail and tend to accumulate.weaviate.conf.jsonsentence names the--config-fileflag and the camelCase field shape. Without that it was unusable: it said "the same settings", but the field names are not the same (hnswDisableSnapshots, notPERSISTENCE_HNSW_DISABLE_SNAPSHOTS), so a reader grepping their config file would find nothing and conclude they were unaffected. Note this path is also silent — env vars log a deprecation warning at startup, config-file fields are accepted and ignored with none. That file is documented nowhere in this repo; tracked separately.Implementation note
The
{#pre-v1-39-configuration}anchor sits on the heading above the<details>, not inside it. Docusaurus'sDetailscomponent has nohashchangeor location-hash handling and only toggles on summary click, so an anchor inside would strand the five inbound env-var links on a collapsed summary. It also renders withlazy={false}, so the collapsed content is in the built DOM — meaning a "is the anchor in the HTML?" check passes even when the anchor is unreachable.Verification
yarn buildandyarn build-devboth pass.validate-links-pr.jsreports only thegoogletagmanagerURL that needsGOOGLE_CONTAINER_ID, which is not available locally. All five retargeted env-var deep links resolve, both anchors confirmed outside the collapsible in the built HTML, and the redirect was checked against preceding wildcards for shadowing.